libdnet-1.12/0000755000076500007650000000000010554406447014237 5ustar dugsongdugsong00000000000000libdnet-1.12/acconfig.h0000644000076500007650000000077610204314360016153 0ustar dugsongdugsong00000000000000@BOTTOM@ #include #ifdef HAVE_WINSOCK2_H # include # include #endif #ifdef __svr4__ # define BSD_COMP 1 #endif #if defined(__osf__) && !defined(_SOCKADDR_LEN) # define _SOCKADDR_LEN 1 #endif #ifndef HAVE_INET_PTON int inet_pton(int, const char *, void *); #endif #ifndef HAVE_STRLCAT int strlcat(char *, const char *, int); #endif #ifndef HAVE_STRLCPY int strlcpy(char *, const char *, int); #endif #ifndef HAVE_STRSEP char *strsep(char **, const char *); #endif libdnet-1.12/aclocal.m40000644000076500007650000075262710552002506016104 0ustar dugsongdugsong00000000000000# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... AC_PREREQ([2.52]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_][CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_][CC], defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_][CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_][CXX], defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 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. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.6.3])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break 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_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional \"$1\" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_PREREQ([2.52]) # serial 6 # 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. We must strip everything past the first ":", # and everything past the last "/". # _AM_DIRNAME(PATH) # ----------------- # Like AS_DIRNAME, only do it during macro expansion AC_DEFUN([_AM_DIRNAME], [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, m4_if(regexp([$1], [^/.*]), -1, [.], patsubst([$1], [^\(/\).*], [\1])), patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl ])# _AM_DIRNAME # The stamp files are numbered to have different names. # We could number them on a directory basis, but that's additional # complications, let's have a unique counter. m4_define([_AM_STAMP_Count], [0]) # _AM_STAMP(HEADER) # ----------------- # The name of the stamp file for HEADER. AC_DEFUN([_AM_STAMP], [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl AS_ESCAPE(_AM_DIRNAME(patsubst([$1], [:.*])))/stamp-h[]_AM_STAMP_Count]) # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) # ------------------------------------------------------------ # We used to try to get a real timestamp in stamp-h. But the fear is that # that will cause unnecessary cvs conflicts. AC_DEFUN([_AM_CONFIG_HEADER], [# Add the stamp file to the list of files AC keeps track of, # along with our hook. AC_CONFIG_HEADERS([$1], [# update the timestamp echo 'timestamp for $1' >"_AM_STAMP([$1])" $2], [$3]) ])# _AM_CONFIG_HEADER # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) # -------------------------------------------------------------- AC_DEFUN([AM_CONFIG_HEADER], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) ])# AM_CONFIG_HEADER # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to undo escaping of the cmd sep variable unescape_variable_subst='s/\\\(${_S_}\)/\1/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib\${_S_}$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib\${_S_}$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds\${_S_}\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler 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 else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; *) # 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"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . 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}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in NOT-darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`${_S_} dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} dldir=$destdir/`dirname \$dlpath`${_S_} test -d \$dldir || mkdir -p \$dldir${_S_} $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} dlpath=$dir/\$dldll${_S_} $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="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.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='.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' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf 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 ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 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 ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds\${_S_}\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[[012]]) test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else 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 unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[[012]]) test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' fi ;; esac ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done${_S_} echo "-hidden">> $lib.exp${_S_} $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 $objdir/so_locations -o $lib${_S_} $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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 s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGISTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc|ecc) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE${_S_}$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll${_S_}linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[[012]]) test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def${_S_}$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def${_S_}$echo DATA >> $output_objdir/$libname.def${_S_}$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def${_S_}$echo EXPORTS >> $output_objdir/$libname.def${_S_}emxexp $libobjs >> $output_objdir/$libname.def${_S_}$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp${_S_} $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib${_S_}$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags${_S_}$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *"$_S_"*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) dnl dnl Check for 4.4 BSD sa_len member in sockaddr struct dnl dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN(AC_DNET_SOCKADDR_SA_LEN, [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_dnet_sockaddr_has_sa_len=yes, ac_cv_dnet_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_dnet_sockaddr_has_sa_len) if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr struct has sa_len.]) fi]) dnl dnl Check for sockaddr_in6 struct in dnl dnl usage: AC_DNET_SOCKADDR_IN6 dnl results: HAVE_SOCKADDR_IN6 dnl AC_DEFUN(AC_DNET_SOCKADDR_IN6, [AC_MSG_CHECKING(for sockaddr_in6 struct in ) AC_CACHE_VAL(ac_cv_dnet_netinet_in_h_has_sockaddr_in6, AC_TRY_COMPILE([ # include # include # include ], [struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6;], ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes, ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no)) AC_MSG_RESULT($ac_cv_dnet_netinet_in_h_has_sockaddr_in6) if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then AC_DEFINE(HAVE_SOCKADDR_IN6, 1, [Define if has sockaddr_in6 struct.]) fi]) dnl dnl Check for arp_dev member in arpreq struct dnl dnl usage: AC_DNET_ARPREQ_ARP_DEV dnl results: HAVE_ARPREQ_ARP_DEV (defined) dnl AC_DEFUN(AC_DNET_ARPREQ_ARP_DEV, [AC_MSG_CHECKING(for arp_dev in arpreq struct) AC_CACHE_VAL(ac_cv_dnet_arpreq_has_arp_dev, AC_TRY_COMPILE([ # include # include # include ], [void *p = ((struct arpreq *)0)->arp_dev], ac_cv_dnet_arpreq_has_arp_dev=yes, ac_cv_dnet_arpreq_has_arp_dev=no)) AC_MSG_RESULT($ac_cv_dnet_arpreq_has_arp_dev) if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then AC_DEFINE(HAVE_ARPREQ_ARP_DEV, 1, [Define if arpreq struct has arp_dev.]) fi]) dnl dnl Check for rt_msghdr struct in dnl dnl usage: AC_DNET_ROUTE_RT_MSGHDR dnl results: HAVE_ROUTE_RT_MSGHDR dnl AC_DEFUN(AC_DNET_ROUTE_RT_MSGHDR, [AC_MSG_CHECKING(for rt_msghdr struct in ) AC_CACHE_VAL(ac_cv_dnet_route_h_has_rt_msghdr, AC_TRY_COMPILE([ # include # include # include # include ], [struct rt_msghdr rtm; rtm.rtm_msglen = 0;], ac_cv_dnet_route_h_has_rt_msghdr=yes, ac_cv_dnet_route_h_has_rt_msghdr=no)) AC_MSG_RESULT($ac_cv_dnet_route_h_has_rt_msghdr) if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then AC_DEFINE(HAVE_ROUTE_RT_MSGHDR, 1, [Define if has rt_msghdr struct.]) fi]) dnl dnl Check for the Berkeley Packet Filter dnl dnl usage: AC_DNET_BSD_BPF dnl results: HAVE_BSD_BPF dnl AC_DEFUN(AC_DNET_BSD_BPF, [AC_MSG_CHECKING(for Berkeley Packet Filter) AC_CACHE_VAL(ac_cv_dnet_bsd_bpf, if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi) AC_MSG_RESULT($ac_cv_dnet_bsd_bpf) if test $ac_cv_dnet_bsd_bpf = yes ; then AC_DEFINE(HAVE_BSD_BPF, 1, [Define if you have the Berkeley Packet Filter.]) fi]) dnl dnl Check for the Linux /proc filesystem dnl dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl AC_DEFUN(AC_DNET_LINUX_PROCFS, [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_procfs) if test $ac_cv_dnet_linux_procfs = yes ; then AC_DEFINE(HAVE_LINUX_PROCFS, 1, [Define if you have the Linux /proc filesystem.]) fi]) dnl dnl Check for Linux PF_PACKET sockets dnl dnl usage: AC_DNET_LINUX_PF_PACKET dnl results: HAVE_LINUX_PF_PACKET dnl AC_DEFUN(AC_DNET_LINUX_PF_PACKET, [AC_MSG_CHECKING(for Linux PF_PACKET sockets) AC_CACHE_VAL(ac_cv_dnet_linux_pf_packet, if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_pf_packet) if test $ac_cv_dnet_linux_pf_packet = yes ; then AC_DEFINE(HAVE_LINUX_PF_PACKET, 1, [Define if you have Linux PF_PACKET sockets.]) fi]) dnl dnl Check for SNMP MIB2 STREAMS (Solaris only?) dnl dnl usage: AC_DNET_STREAMS_MIB2 dnl results: HAVE_STREAMS_MIB2 dnl AC_DEFUN(AC_DNET_STREAMS_MIB2, [AC_MSG_CHECKING(for SNMP MIB2 STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_mib2, if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_mib2) if test $ac_cv_dnet_streams_mib2 = yes ; then AC_DEFINE(HAVE_STREAMS_MIB2, 1, [Define if you have SNMP MIB2 STREAMS.]) fi]) dnl dnl Check for route(7) STREAMS (UnixWare only?) dnl dnl usage: AC_DNET_STREAMS_ROUTE dnl results: HAVE_STREAMS_ROUTE dnl AC_DEFUN(AC_DNET_STREAMS_ROUTE, [AC_MSG_CHECKING(for route(7) STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_route, if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_route) if test $ac_cv_dnet_streams_route = yes ; then AC_DEFINE(HAVE_STREAMS_ROUTE, 1, [Define if you have route(7) STREAMS.]) fi]) dnl dnl Check for arp(7) ioctls dnl dnl usage: AC_DNET_IOCTL_ARP dnl results: HAVE_IOCTL_ARP dnl AC_DEFUN(AC_DNET_IOCTL_ARP, [AC_MSG_CHECKING(for arp(7) ioctls) AC_CACHE_VAL(ac_cv_dnet_ioctl_arp, AC_EGREP_CPP(werd, [ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif], ac_cv_dnet_ioctl_arp=yes, ac_cv_dnet_ioctl_arp=no)) case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac AC_MSG_RESULT($ac_cv_dnet_ioctl_arp) if test $ac_cv_dnet_ioctl_arp = yes ; then AC_DEFINE(HAVE_IOCTL_ARP, 1, [Define if you have arp(7) ioctls.]) fi]) dnl dnl Check for raw IP sockets ip_{len,off} host byte ordering dnl dnl usage: AC_DNET_RAWIP_HOST_OFFLEN dnl results: HAVE_RAWIP_HOST_OFFLEN dnl AC_DEFUN(AC_DNET_RAWIP_HOST_OFFLEN, [AC_MSG_CHECKING([for raw IP sockets ip_{len,off} host byte ordering]) AC_CACHE_VAL(ac_cv_dnet_rawip_host_offlen, [ case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_host_offlen) if test $ac_cv_dnet_rawip_host_offlen = yes ; then AC_DEFINE(HAVE_RAWIP_HOST_OFFLEN, 1, [Define if raw IP sockets require host byte ordering for ip_off, ip_len.]) fi]) dnl dnl Check for cooked raw IP sockets dnl dnl usage: AC_DNET_RAWIP_COOKED dnl results: HAVE_RAWIP_COOKED dnl AC_DEFUN(AC_DNET_RAWIP_COOKED, [AC_MSG_CHECKING(for cooked raw IP sockets) AC_CACHE_VAL(ac_cv_dnet_rawip_cooked, [ case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_cooked) if test $ac_cv_dnet_rawip_cooked = yes ; then AC_DEFINE(HAVE_RAWIP_COOKED, 1, [Define if you have cooked raw IP sockets.]) fi]) dnl dnl AC_LBL_LIBRARY_NET dnl dnl This test is for network applications that need socket() and dnl gethostbyname() -ish functions. Under Solaris, those applications dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link dnl with "-lnsl" but should *not* link with "-lsocket" because dnl libsocket.a breaks a number of things (for instance: dnl gethostbyname() under IRIX 5.2, and snoop sockets under most dnl versions of IRIX). dnl dnl Unfortunately, many application developers are not aware of this, dnl and mistakenly write tests that cause -lsocket to be used under dnl IRIX. It is also easy to write tests that cause -lnsl to be used dnl under operating systems where neither are necessary (or useful), dnl such as SunOS 4.1.4, which uses -lnsl for TLI. dnl dnl This test exists so that every application developer does not test dnl this in a different, and subtly broken fashion. dnl It has been argued that this test should be broken up into two dnl seperate tests, one for the resolver libraries, and one for the dnl libraries necessary for using Sockets API. Unfortunately, the two dnl are carefully intertwined and allowing the autoconf user to use dnl them independantly potentially results in unfortunate ordering dnl dependancies -- as such, such component macros would have to dnl carefully use indirection and be aware if the other components were dnl executed. Since other autoconf macros do not go to this trouble, dnl and almost no applications use sockets without the resolver, this dnl complexity has not been implemented. dnl dnl The check for libresolv is in case you are attempting to link dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl AC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , # Some OSes (eg. Solaris) place it in libnsl: AC_CHECK_LIB(nsl, gethostbyname, , # Some strange OSes (SINIX) have it in libsocket: AC_CHECK_LIB(socket, gethostbyname, , # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", AC_CHECK_LIB(resolv, gethostbyname), -lnsl)))) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_CHECK_LIB(str, putmsg) ]) libdnet-1.12/config/0000755000076500007650000000000010554406446015503 5ustar dugsongdugsong00000000000000libdnet-1.12/config/acinclude.m40000644000076500007650000002465610552362272017705 0ustar dugsongdugsong00000000000000dnl dnl Check for 4.4 BSD sa_len member in sockaddr struct dnl dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN(AC_DNET_SOCKADDR_SA_LEN, [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_dnet_sockaddr_has_sa_len=yes, ac_cv_dnet_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_dnet_sockaddr_has_sa_len) if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr struct has sa_len.]) fi]) dnl dnl Check for sockaddr_in6 struct in dnl dnl usage: AC_DNET_SOCKADDR_IN6 dnl results: HAVE_SOCKADDR_IN6 dnl AC_DEFUN(AC_DNET_SOCKADDR_IN6, [AC_MSG_CHECKING(for sockaddr_in6 struct in ) AC_CACHE_VAL(ac_cv_dnet_netinet_in_h_has_sockaddr_in6, AC_TRY_COMPILE([ # include # include # include ], [struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6;], ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes, ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no)) AC_MSG_RESULT($ac_cv_dnet_netinet_in_h_has_sockaddr_in6) if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then AC_DEFINE(HAVE_SOCKADDR_IN6, 1, [Define if has sockaddr_in6 struct.]) fi]) dnl dnl Check for arp_dev member in arpreq struct dnl dnl usage: AC_DNET_ARPREQ_ARP_DEV dnl results: HAVE_ARPREQ_ARP_DEV (defined) dnl AC_DEFUN(AC_DNET_ARPREQ_ARP_DEV, [AC_MSG_CHECKING(for arp_dev in arpreq struct) AC_CACHE_VAL(ac_cv_dnet_arpreq_has_arp_dev, AC_TRY_COMPILE([ # include # include # include ], [void *p = ((struct arpreq *)0)->arp_dev], ac_cv_dnet_arpreq_has_arp_dev=yes, ac_cv_dnet_arpreq_has_arp_dev=no)) AC_MSG_RESULT($ac_cv_dnet_arpreq_has_arp_dev) if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then AC_DEFINE(HAVE_ARPREQ_ARP_DEV, 1, [Define if arpreq struct has arp_dev.]) fi]) dnl dnl Check for rt_msghdr struct in dnl dnl usage: AC_DNET_ROUTE_RT_MSGHDR dnl results: HAVE_ROUTE_RT_MSGHDR dnl AC_DEFUN(AC_DNET_ROUTE_RT_MSGHDR, [AC_MSG_CHECKING(for rt_msghdr struct in ) AC_CACHE_VAL(ac_cv_dnet_route_h_has_rt_msghdr, AC_TRY_COMPILE([ # include # include # include # include ], [struct rt_msghdr rtm; rtm.rtm_msglen = 0;], ac_cv_dnet_route_h_has_rt_msghdr=yes, ac_cv_dnet_route_h_has_rt_msghdr=no)) AC_MSG_RESULT($ac_cv_dnet_route_h_has_rt_msghdr) if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then AC_DEFINE(HAVE_ROUTE_RT_MSGHDR, 1, [Define if has rt_msghdr struct.]) fi]) dnl dnl Check for the Berkeley Packet Filter dnl dnl usage: AC_DNET_BSD_BPF dnl results: HAVE_BSD_BPF dnl AC_DEFUN(AC_DNET_BSD_BPF, [AC_MSG_CHECKING(for Berkeley Packet Filter) AC_CACHE_VAL(ac_cv_dnet_bsd_bpf, if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi) AC_MSG_RESULT($ac_cv_dnet_bsd_bpf) if test $ac_cv_dnet_bsd_bpf = yes ; then AC_DEFINE(HAVE_BSD_BPF, 1, [Define if you have the Berkeley Packet Filter.]) fi]) dnl dnl Check for the Linux /proc filesystem dnl dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl AC_DEFUN(AC_DNET_LINUX_PROCFS, [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_procfs) if test $ac_cv_dnet_linux_procfs = yes ; then AC_DEFINE(HAVE_LINUX_PROCFS, 1, [Define if you have the Linux /proc filesystem.]) fi]) dnl dnl Check for Linux PF_PACKET sockets dnl dnl usage: AC_DNET_LINUX_PF_PACKET dnl results: HAVE_LINUX_PF_PACKET dnl AC_DEFUN(AC_DNET_LINUX_PF_PACKET, [AC_MSG_CHECKING(for Linux PF_PACKET sockets) AC_CACHE_VAL(ac_cv_dnet_linux_pf_packet, if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_pf_packet) if test $ac_cv_dnet_linux_pf_packet = yes ; then AC_DEFINE(HAVE_LINUX_PF_PACKET, 1, [Define if you have Linux PF_PACKET sockets.]) fi]) dnl dnl Check for SNMP MIB2 STREAMS (Solaris only?) dnl dnl usage: AC_DNET_STREAMS_MIB2 dnl results: HAVE_STREAMS_MIB2 dnl AC_DEFUN(AC_DNET_STREAMS_MIB2, [AC_MSG_CHECKING(for SNMP MIB2 STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_mib2, if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_mib2) if test $ac_cv_dnet_streams_mib2 = yes ; then AC_DEFINE(HAVE_STREAMS_MIB2, 1, [Define if you have SNMP MIB2 STREAMS.]) fi]) dnl dnl Check for route(7) STREAMS (UnixWare only?) dnl dnl usage: AC_DNET_STREAMS_ROUTE dnl results: HAVE_STREAMS_ROUTE dnl AC_DEFUN(AC_DNET_STREAMS_ROUTE, [AC_MSG_CHECKING(for route(7) STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_route, if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_route) if test $ac_cv_dnet_streams_route = yes ; then AC_DEFINE(HAVE_STREAMS_ROUTE, 1, [Define if you have route(7) STREAMS.]) fi]) dnl dnl Check for arp(7) ioctls dnl dnl usage: AC_DNET_IOCTL_ARP dnl results: HAVE_IOCTL_ARP dnl AC_DEFUN(AC_DNET_IOCTL_ARP, [AC_MSG_CHECKING(for arp(7) ioctls) AC_CACHE_VAL(ac_cv_dnet_ioctl_arp, AC_EGREP_CPP(werd, [ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif], ac_cv_dnet_ioctl_arp=yes, ac_cv_dnet_ioctl_arp=no)) case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac AC_MSG_RESULT($ac_cv_dnet_ioctl_arp) if test $ac_cv_dnet_ioctl_arp = yes ; then AC_DEFINE(HAVE_IOCTL_ARP, 1, [Define if you have arp(7) ioctls.]) fi]) dnl dnl Check for raw IP sockets ip_{len,off} host byte ordering dnl dnl usage: AC_DNET_RAWIP_HOST_OFFLEN dnl results: HAVE_RAWIP_HOST_OFFLEN dnl AC_DEFUN(AC_DNET_RAWIP_HOST_OFFLEN, [AC_MSG_CHECKING([for raw IP sockets ip_{len,off} host byte ordering]) AC_CACHE_VAL(ac_cv_dnet_rawip_host_offlen, [ case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_host_offlen) if test $ac_cv_dnet_rawip_host_offlen = yes ; then AC_DEFINE(HAVE_RAWIP_HOST_OFFLEN, 1, [Define if raw IP sockets require host byte ordering for ip_off, ip_len.]) fi]) dnl dnl Check for cooked raw IP sockets dnl dnl usage: AC_DNET_RAWIP_COOKED dnl results: HAVE_RAWIP_COOKED dnl AC_DEFUN(AC_DNET_RAWIP_COOKED, [AC_MSG_CHECKING(for cooked raw IP sockets) AC_CACHE_VAL(ac_cv_dnet_rawip_cooked, [ case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_cooked) if test $ac_cv_dnet_rawip_cooked = yes ; then AC_DEFINE(HAVE_RAWIP_COOKED, 1, [Define if you have cooked raw IP sockets.]) fi]) dnl dnl AC_LBL_LIBRARY_NET dnl dnl This test is for network applications that need socket() and dnl gethostbyname() -ish functions. Under Solaris, those applications dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link dnl with "-lnsl" but should *not* link with "-lsocket" because dnl libsocket.a breaks a number of things (for instance: dnl gethostbyname() under IRIX 5.2, and snoop sockets under most dnl versions of IRIX). dnl dnl Unfortunately, many application developers are not aware of this, dnl and mistakenly write tests that cause -lsocket to be used under dnl IRIX. It is also easy to write tests that cause -lnsl to be used dnl under operating systems where neither are necessary (or useful), dnl such as SunOS 4.1.4, which uses -lnsl for TLI. dnl dnl This test exists so that every application developer does not test dnl this in a different, and subtly broken fashion. dnl It has been argued that this test should be broken up into two dnl seperate tests, one for the resolver libraries, and one for the dnl libraries necessary for using Sockets API. Unfortunately, the two dnl are carefully intertwined and allowing the autoconf user to use dnl them independantly potentially results in unfortunate ordering dnl dependancies -- as such, such component macros would have to dnl carefully use indirection and be aware if the other components were dnl executed. Since other autoconf macros do not go to this trouble, dnl and almost no applications use sockets without the resolver, this dnl complexity has not been implemented. dnl dnl The check for libresolv is in case you are attempting to link dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl AC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , # Some OSes (eg. Solaris) place it in libnsl: AC_CHECK_LIB(nsl, gethostbyname, , # Some strange OSes (SINIX) have it in libsocket: AC_CHECK_LIB(socket, gethostbyname, , # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", AC_CHECK_LIB(resolv, gethostbyname), -lnsl)))) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_CHECK_LIB(str, putmsg) ]) libdnet-1.12/config/config.guess0000755000076500007650000011544310363626525020033 0ustar dugsongdugsong00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-07-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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. # This shell variable is my proudest work .. or something. --bje set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; (old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; dummy=$tmpdir/dummy ; files="$dummy.c $dummy.o $dummy.rel $dummy" ; trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $files ; 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 ; unset files' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # 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. eval $set_cc_for_build cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; 3-1307) UNAME_MACHINE="alphaev7" ;; esac fi rm -f $dummy.s $dummy && rmdir $tmpdir echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; 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 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; 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 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # 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 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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 $dummy.c -o $dummy \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; 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 0 ;; *: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 $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo rs6000-ibm-aix3.2.5 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 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy && rmdir $tmpdir fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 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 $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c && rmdir $tmpdir echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i386-pc-interix3 exit 0 ;; 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 i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` rm -f $dummy.c && rmdir $tmpdir test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c && rmdir $tmpdir test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 0 ;; 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 0 ;; 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 0 ;; i*86:*:5:[78]*) 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 0 ;; 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 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*: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) 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; 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 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *: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 0 ;; 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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 rm -f $dummy.c $dummy && rmdir $tmpdir # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libdnet-1.12/config/config.sub0000755000076500007650000007145310363626525017500 0ustar dugsongdugsong00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-07-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 0;; * ) 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* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -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/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipstx39 | mipstx39el \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; 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 ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; 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 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-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-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; 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 ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3d) basic_machine=alpha-cray os=-unicos ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; 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 ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; 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 ;; sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -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*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -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 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -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 ;; -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 ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -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 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libdnet-1.12/config/install-sh0000755000076500007650000001270110363626525017510 0ustar dugsongdugsong00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 libdnet-1.12/config/ltmain.sh0000644000076500007650000054667410046062607017342 0ustar dugsongdugsong00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.6 TIMESTAMP=" (1.1220.2.94 2004/04/10 16:27:27)" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $EXIT_SUCCESS ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #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 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libdnet-1.12/config/missing0000755000076500007650000002404010363626525017102 0ustar dugsongdugsong00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 libdnet-1.12/config/mkinstalldirs0000755000076500007650000000341110363626525020310 0ustar dugsongdugsong00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here libdnet-1.12/configure0000755000076500007650000271302410554377612016160 0ustar dugsongdugsong00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=`echo "$tagnames,CXX" | sed 's/^,//'` tagnames=`echo "$tagnames,F77" | sed 's/^,//'` # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="include/dnet.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ac_aux_dir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PYTHON TCLINC TCLLIB PYTHON_TRUE PYTHON_FALSE TCL_TRUE TCL_FALSE CHECKINC CHECKLIB HAVE_CHECK_TRUE HAVE_CHECK_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-python=DIR build Python module (using python in DIR) --with-wpdpack=DIR use WinPcap developer's pack in DIR --with-check=DIR use Check (http://check.sf.net) in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config $srcdir/config; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.6" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=libdnet VERSION=1.12 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Add the stamp file to the list of files AC keeps track of, # along with our hook. ac_config_headers="$ac_config_headers include/config.h" echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in *cygwin*) CYGWIN=yes;; *) CYGWIN=no;; esac if test "$prefix" = "NONE"; then prefix="/usr/local" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-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 or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-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; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `"$LD" -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$CC -nostdlib -Xlinker$reload_flag $archargs -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) 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* | mingw* | pw32*) # 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='win32_libid' ;; darwin* | rhapsody*) # this will be overwritten by pass_all, but leave it in just in case lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac lt_cv_deplibs_check_method=pass_all ;; freebsd*) 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)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $host_os in irix5* | nonstopux*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) case $host_cpu in alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 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 ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 3705 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5237:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 testring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; *) # 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"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring=$testring$testring done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGISTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to undo escaping of the cmd sep variable unescape_variable_subst='s/\\\(${_S_}\)/\1/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib\${_S_}$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib\${_S_}$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds\${_S_}\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=yes enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler 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 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6267: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6271: \$? = $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 if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 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 ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6499: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6503: \$? = $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 if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . 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}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6566: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6570: \$? = $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 if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then 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 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${_S_}$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll${_S_}linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; darwin1.* | darwin[2-6].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[012]) test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then allow_undefined_flag='-flat_namespace -undefined suppress' else allow_undefined_flag='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname${_S_}$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname${_S_}$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def${_S_}$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def${_S_}$echo DATA >> $output_objdir/$libname.def${_S_}$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def${_S_}$echo EXPORTS >> $output_objdir/$libname.def${_S_}emxexp $libobjs >> $output_objdir/$libname.def${_S_}$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp${_S_} $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib${_S_}$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags${_S_}$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *"$_S_"*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in NOT-darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`${_S_} dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} dldir=$destdir/`dirname \$dlpath`${_S_} test -d \$dldir || mkdir -p \$dldir${_S_} $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} dlpath=$dir/\$dldll${_S_} $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="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.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='.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' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf 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 ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds\${_S_}\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; darwin1.* | darwin[2-6].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[012]) test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then allow_undefined_flag='-flat_namespace -undefined suppress' else allow_undefined_flag='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\" -e \"\$unescape_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # 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 s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else 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 unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `"$LD" -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; darwin1.* | darwin[2-6].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[012]) test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then allow_undefined_flag_CXX='-flat_namespace -undefined suppress' else allow_undefined_flag_CXX='-undefined dynamic_lookup' fi ;; esac ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname${_S_}$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname${_S_}$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done${_S_} echo "-hidden">> $lib.exp${_S_} $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 $objdir/so_locations -o $lib${_S_} $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:10979: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:10983: \$? = $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 if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . 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}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11046: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11050: \$? = $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 if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *"$_S_"*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in NOT-darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`${_S_} dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} dldir=$destdir/`dirname \$dlpath`${_S_} test -d \$dldir || mkdir -p \$dldir${_S_} $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} dlpath=$dir/\$dldll${_S_} $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="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.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='.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' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf 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 ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\" -e \"\$unescape_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds\${_S_}\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13298: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13302: \$? = $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 if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . 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}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13365: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13369: \$? = $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 if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE${_S_}$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll${_S_}linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; darwin1.* | darwin[2-6].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[012]) test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then allow_undefined_flag_F77='-flat_namespace -undefined suppress' else allow_undefined_flag_F77='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname${_S_}$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname${_S_}$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def${_S_}$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def${_S_}$echo DATA >> $output_objdir/$libname.def${_S_}$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def${_S_}$echo EXPORTS >> $output_objdir/$libname.def${_S_}emxexp $libobjs >> $output_objdir/$libname.def${_S_}$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp${_S_} $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib${_S_}$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags${_S_}$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *"$_S_"*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in NOT-darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`${_S_} dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} dldir=$destdir/`dirname \$dlpath`${_S_} test -d \$dldir || mkdir -p \$dldir${_S_} $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} dlpath=$dir/\$dldll${_S_} $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="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.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='.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' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf 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 ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\" -e \"\$unescape_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15344: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15348: \$? = $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 if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc|ecc) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15576: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15580: \$? = $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 if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . 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}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15643: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15647: \$? = $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 if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi${_S_} $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE${_S_}$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll${_S_}linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; darwin1.* | darwin[2-6].*) # Darwin 1.3 on, but less than 7.0 test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; *) # Darwin 7.0 on case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in 10.[012]) test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; *) # 10.3 on if test -z ${LD_TWOLEVEL_NAMESPACE}; then allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' else allow_undefined_flag_GCJ='-undefined dynamic_lookup' fi ;; esac ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. Also zsh mangles # `"' quotes if we put them in here... so don't! lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname${_S_}$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname${_S_}$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def${_S_}$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def${_S_}$echo DATA >> $output_objdir/$libname.def${_S_}$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def${_S_}$echo EXPORTS >> $output_objdir/$libname.def${_S_}emxexp $libobjs >> $output_objdir/$libname.def${_S_}$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp${_S_} $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib${_S_}$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags${_S_}$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *"$_S_"*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in NOT-darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`${_S_} dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} dldir=$destdir/`dirname \$dlpath`${_S_} test -d \$dldir || mkdir -p \$dldir${_S_} $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} dlpath=$dir/\$dldll${_S_} $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="/lib /lib/w32api /usr/lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext='.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='.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' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # 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}${release}${shared_ext} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf 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 ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\" -e \"\$unescape_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\" -e \"\$unescape_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Set the command separator (default: ~) _S_=\${LIBTOOL_CMD_SEP-\~} # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext='$shrext' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking for Python" >&5 echo $ECHO_N "checking for Python... $ECHO_C" >&6 # Check whether --with-python or --without-python was given. if test "${with_python+set}" = set; then withval="$with_python" case "$withval" in yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 PYTHON="python" ;; no) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; *) echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 for subdir in . bin; do if test -x $withval/$subdir/python; then owd=`pwd` if cd $withval/$subdir; then withval=`pwd`; cd $owd; fi PYTHON="$withval/python" break fi done if test "x$PYTHON" = "x"; then { { echo "$as_me:$LINENO: error: python not found in $withval" >&5 echo "$as_me: error: python not found in $withval" >&2;} { (exit 1); exit 1; }; } fi ;; esac fi; if test "x$PYTHON" != "x"; then PYTHON_TRUE= PYTHON_FALSE='#' else PYTHON_TRUE='#' PYTHON_FALSE= fi if test "x$TCLINC" != "x"; then TCL_TRUE= TCL_FALSE='#' else TCL_TRUE='#' TCL_FALSE= fi if test -r /usr/include/sgidefs.h ; then CPPFLAGS="$CPPFLAGS -D__sgi" fi if test "$CYGWIN" = yes ; then if test -d /usr/include/mingw ; then CPPFLAGS="$CPPFLAGS -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin" cat >>confdefs.h <<\_ACEOF #define WIN32_LEAN_AND_MEAN 1 _ACEOF echo "$as_me:$LINENO: checking for main in -lws2_32" >&5 echo $ECHO_N "checking for main in -lws2_32... $ECHO_C" >&6 if test "${ac_cv_lib_ws2_32_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ws2_32_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ws2_32_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_main" >&5 echo "${ECHO_T}$ac_cv_lib_ws2_32_main" >&6 if test $ac_cv_lib_ws2_32_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi echo "$as_me:$LINENO: checking for main in -liphlpapi" >&5 echo $ECHO_N "checking for main in -liphlpapi... $ECHO_C" >&6 if test "${ac_cv_lib_iphlpapi_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_iphlpapi_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iphlpapi_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_iphlpapi_main" >&5 echo "${ECHO_T}$ac_cv_lib_iphlpapi_main" >&6 if test $ac_cv_lib_iphlpapi_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi cat >>confdefs.h <<\_ACEOF #define snprintf _snprintf _ACEOF else { { echo "$as_me:$LINENO: error: need MingW32 package to build under Cygwin" >&5 echo "$as_me: error: need MingW32 package to build under Cygwin" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for WinPcap developer's pack" >&5 echo $ECHO_N "checking for WinPcap developer's pack... $ECHO_C" >&6 # Check whether --with-wpdpack or --without-wpdpack was given. if test "${with_wpdpack+set}" = set; then withval="$with_wpdpack" echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 if test -f $withval/include/packet32.h -a -f $withval/lib/packet.lib; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CFLAGS="$CFLAGS -I$withval/include" LIBS="$LIBS -L$withval/lib -lpacket" else { { echo "$as_me:$LINENO: error: packet32.h or packet.lib not found in $withval" >&5 echo "$as_me: error: packet32.h or packet.lib not found in $withval" >&2;} { (exit 1); exit 1; }; } fi else for dir in ${prefix} ${HOME}/WPdpack ; do if test -f ${dir}/include/packet32.h -a -f ${dir}/lib/packet.lib; then CFLAGS="$CFLAGS -I${dir}/include" LIBS="$LIBS -L${dir}/lib -lpacket" have_pcap=yes break; fi done if test "$have_pcap" != yes; then { { echo "$as_me:$LINENO: error: WinPcap developer's pack not found" >&5 echo "$as_me: error: WinPcap developer's pack not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi; fi if test "$CYGWIN" != yes ; then # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else # Some OSes (eg. Solaris) place it in libnsl: echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" else # Some strange OSes (SINIX) have it in libsocket: echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5 echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6 if test $ac_cv_lib_socket_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" else # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5 echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6 if test $ac_cv_lib_socket_gethostbyname = yes; then LIBS="-lsocket -lnsl $LIBS" else echo "$as_me:$LINENO: checking for gethostbyname in -lresolv" >&5 echo $ECHO_N "checking for gethostbyname in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_gethostbyname" >&6 if test $ac_cv_lib_resolv_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi fi fi fi fi echo "$as_me:$LINENO: checking for socket" >&5 echo $ECHO_N "checking for socket... $ECHO_C" >&6 if test "${ac_cv_func_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define socket to an innocuous variant, in case declares socket. For example, HP-UX 11i declares gettimeofday. */ #define socket innocuous_socket /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef socket /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); /* 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_socket) || defined (__stub___socket) choke me #else char (*f) () = socket; #endif #ifdef __cplusplus } #endif int main () { return f != socket; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5 echo "${ECHO_T}$ac_cv_func_socket" >&6 if test $ac_cv_func_socket = yes; then : else echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" else echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket -lnsl $LIBS" fi fi fi # DLPI needs putmsg under HPUX so test for -lstr while we're at it echo "$as_me:$LINENO: checking for putmsg in -lstr" >&5 echo $ECHO_N "checking for putmsg in -lstr... $ECHO_C" >&6 if test "${ac_cv_lib_str_putmsg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lstr $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char putmsg (); int main () { putmsg (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_str_putmsg=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_str_putmsg=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_str_putmsg" >&5 echo "${ECHO_T}$ac_cv_lib_str_putmsg" >&6 if test $ac_cv_lib_str_putmsg = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSTR 1 _ACEOF LIBS="-lstr $LIBS" fi echo "$as_me:$LINENO: checking for open_mib in -lnm" >&5 echo $ECHO_N "checking for open_mib in -lnm... $ECHO_C" >&6 if test "${ac_cv_lib_nm_open_mib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char open_mib (); int main () { open_mib (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nm_open_mib=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nm_open_mib=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nm_open_mib" >&5 echo "${ECHO_T}$ac_cv_lib_nm_open_mib" >&6 if test $ac_cv_lib_nm_open_mib = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNM 1 _ACEOF LIBS="-lnm $LIBS" fi fi echo "$as_me:$LINENO: checking for Check" >&5 echo $ECHO_N "checking for Check... $ECHO_C" >&6 # Check whether --with-check or --without-check was given. if test "${with_check+set}" = set; then withval="$with_check" case "$withval" in yes|no) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; *) echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/include" CHECKLIB="-L$withval/lib -lcheck" elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/src" CHECKLIB="-L$withval/src -lcheck" else { { echo "$as_me:$LINENO: error: check.h or libcheck.a not found in $withval" >&5 echo "$as_me: error: check.h or libcheck.a not found in $withval" >&2;} { (exit 1); exit 1; }; } fi ;; esac else if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then CHECKINC="-I${prefix}/include" CHECKLIB="-L${prefix}/lib -lcheck" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi; if test "x$CHECKLIB" != "x"; then HAVE_CHECK_TRUE= HAVE_CHECK_FALSE='#' else HAVE_CHECK_TRUE='#' HAVE_CHECK_FALSE= fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi if test "$CYGWIN" = yes ; then for ac_header in Iphlpapi.h winsock2.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else for ac_header in fcntl.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h \ sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h \ sys/sysctl.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in net/bpf.h net/if.h net/if_var.h \ net/if_arp.h net/if_dl.h net/pfilt.h \ net/pfvar.h net/radix.h net/raw.h net/route.h netinet/in_var.h \ net/if_tun.h linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h \ linux/ip_fwchains.h linux/netfilter_ipv4/ipchains_core.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h \ netinet/ip_compat.h ip_fil.h netinet/ip_fil.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in hpsecurity.h stropts.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for sockaddr_in6 struct in " >&5 echo $ECHO_N "checking for sockaddr_in6 struct in ... $ECHO_C" >&6 if test "${ac_cv_dnet_netinet_in_h_has_sockaddr_in6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_netinet_in_h_has_sockaddr_in6" >&5 echo "${ECHO_T}$ac_cv_dnet_netinet_in_h_has_sockaddr_in6" >&6 if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_IN6 1 _ACEOF fi if test "$ac_cv_header_sys_socket_h" = yes ; then echo "$as_me:$LINENO: checking for sa_len in sockaddr struct" >&5 echo $ECHO_N "checking for sa_len in sockaddr struct... $ECHO_C" >&6 if test "${ac_cv_dnet_sockaddr_has_sa_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include int main () { u_int i = sizeof(((struct sockaddr *)0)->sa_len) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_sockaddr_has_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_sockaddr_has_sa_len=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_sockaddr_has_sa_len" >&5 echo "${ECHO_T}$ac_cv_dnet_sockaddr_has_sa_len" >&6 if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF fi fi if test "$ac_cv_header_net_if_arp_h" = yes ; then echo "$as_me:$LINENO: checking for arp_dev in arpreq struct" >&5 echo $ECHO_N "checking for arp_dev in arpreq struct... $ECHO_C" >&6 if test "${ac_cv_dnet_arpreq_has_arp_dev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { void *p = ((struct arpreq *)0)->arp_dev ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_arpreq_has_arp_dev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_arpreq_has_arp_dev=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_arpreq_has_arp_dev" >&5 echo "${ECHO_T}$ac_cv_dnet_arpreq_has_arp_dev" >&6 if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_ARPREQ_ARP_DEV 1 _ACEOF fi fi if test "$ac_cv_header_net_route_h" = yes ; then echo "$as_me:$LINENO: checking for rt_msghdr struct in " >&5 echo $ECHO_N "checking for rt_msghdr struct in ... $ECHO_C" >&6 if test "${ac_cv_dnet_route_h_has_rt_msghdr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include # include int main () { struct rt_msghdr rtm; rtm.rtm_msglen = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_route_h_has_rt_msghdr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_route_h_has_rt_msghdr=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_route_h_has_rt_msghdr" >&5 echo "${ECHO_T}$ac_cv_dnet_route_h_has_rt_msghdr" >&6 if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_ROUTE_RT_MSGHDR 1 _ACEOF fi fi if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_func in err strlcat strlcpy strsep do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case $LIBOBJS in "$ac_func.$ac_objext" | \ *" $ac_func.$ac_objext" | \ "$ac_func.$ac_objext "* | \ *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test "$CYGWIN" != yes ; then echo "$as_me:$LINENO: checking for Berkeley Packet Filter" >&5 echo $ECHO_N "checking for Berkeley Packet Filter... $ECHO_C" >&6 if test "${ac_cv_dnet_bsd_bpf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_bsd_bpf" >&5 echo "${ECHO_T}$ac_cv_dnet_bsd_bpf" >&6 if test $ac_cv_dnet_bsd_bpf = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_BSD_BPF 1 _ACEOF fi echo "$as_me:$LINENO: checking for Linux proc filesystem" >&5 echo $ECHO_N "checking for Linux proc filesystem... $ECHO_C" >&6 if test "${ac_cv_dnet_linux_procfs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_linux_procfs" >&5 echo "${ECHO_T}$ac_cv_dnet_linux_procfs" >&6 if test $ac_cv_dnet_linux_procfs = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PROCFS 1 _ACEOF fi echo "$as_me:$LINENO: checking for Linux PF_PACKET sockets" >&5 echo $ECHO_N "checking for Linux PF_PACKET sockets... $ECHO_C" >&6 if test "${ac_cv_dnet_linux_pf_packet+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_linux_pf_packet" >&5 echo "${ECHO_T}$ac_cv_dnet_linux_pf_packet" >&6 if test $ac_cv_dnet_linux_pf_packet = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PF_PACKET 1 _ACEOF fi echo "$as_me:$LINENO: checking for SNMP MIB2 STREAMS" >&5 echo $ECHO_N "checking for SNMP MIB2 STREAMS... $ECHO_C" >&6 if test "${ac_cv_dnet_streams_mib2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_streams_mib2" >&5 echo "${ECHO_T}$ac_cv_dnet_streams_mib2" >&6 if test $ac_cv_dnet_streams_mib2 = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STREAMS_MIB2 1 _ACEOF fi echo "$as_me:$LINENO: checking for route(7) STREAMS" >&5 echo $ECHO_N "checking for route(7) STREAMS... $ECHO_C" >&6 if test "${ac_cv_dnet_streams_route+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_streams_route" >&5 echo "${ECHO_T}$ac_cv_dnet_streams_route" >&6 if test $ac_cv_dnet_streams_route = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STREAMS_ROUTE 1 _ACEOF fi echo "$as_me:$LINENO: checking for arp(7) ioctls" >&5 echo $ECHO_N "checking for arp(7) ioctls... $ECHO_C" >&6 if test "${ac_cv_dnet_ioctl_arp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "werd" >/dev/null 2>&1; then ac_cv_dnet_ioctl_arp=yes else ac_cv_dnet_ioctl_arp=no fi rm -f conftest* fi case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac echo "$as_me:$LINENO: result: $ac_cv_dnet_ioctl_arp" >&5 echo "${ECHO_T}$ac_cv_dnet_ioctl_arp" >&6 if test $ac_cv_dnet_ioctl_arp = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_IOCTL_ARP 1 _ACEOF fi echo "$as_me:$LINENO: checking for raw IP sockets ip_{len,off} host byte ordering" >&5 echo $ECHO_N "checking for raw IP sockets ip_{len,off} host byte ordering... $ECHO_C" >&6 if test "${ac_cv_dnet_rawip_host_offlen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac fi echo "$as_me:$LINENO: result: $ac_cv_dnet_rawip_host_offlen" >&5 echo "${ECHO_T}$ac_cv_dnet_rawip_host_offlen" >&6 if test $ac_cv_dnet_rawip_host_offlen = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_RAWIP_HOST_OFFLEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for cooked raw IP sockets" >&5 echo $ECHO_N "checking for cooked raw IP sockets... $ECHO_C" >&6 if test "${ac_cv_dnet_rawip_cooked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac fi echo "$as_me:$LINENO: result: $ac_cv_dnet_rawip_cooked" >&5 echo "${ECHO_T}$ac_cv_dnet_rawip_cooked" >&6 if test $ac_cv_dnet_rawip_cooked = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_RAWIP_COOKED 1 _ACEOF fi fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "arp-win32.$ac_objext" | \ *" arp-win32.$ac_objext" | \ "arp-win32.$ac_objext "* | \ *" arp-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_ioctl_arp" = yes ; then case $LIBOBJS in "arp-ioctl.$ac_objext" | \ *" arp-ioctl.$ac_objext" | \ "arp-ioctl.$ac_objext "* | \ *" arp-ioctl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-ioctl.$ac_objext" ;; esac elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then case $LIBOBJS in "arp-bsd.$ac_objext" | \ *" arp-bsd.$ac_objext" | \ "arp-bsd.$ac_objext "* | \ *" arp-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-bsd.$ac_objext" ;; esac else case $LIBOBJS in "arp-none.$ac_objext" | \ *" arp-none.$ac_objext" | \ "arp-none.$ac_objext "* | \ *" arp-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "eth-win32.$ac_objext" | \ *" eth-win32.$ac_objext" | \ "eth-win32.$ac_objext "* | \ *" eth-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-win32.$ac_objext" ;; esac elif test "$ac_cv_header_net_pfilt_h" = yes ; then case $LIBOBJS in "eth-pfilt.$ac_objext" | \ *" eth-pfilt.$ac_objext" | \ "eth-pfilt.$ac_objext "* | \ *" eth-pfilt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-pfilt.$ac_objext" ;; esac elif test "$ac_cv_dnet_bsd_bpf" = yes ; then case $LIBOBJS in "eth-bsd.$ac_objext" | \ *" eth-bsd.$ac_objext" | \ "eth-bsd.$ac_objext "* | \ *" eth-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-bsd.$ac_objext" ;; esac elif test "$ac_cv_dnet_linux_pf_packet" = yes ; then case $LIBOBJS in "eth-linux.$ac_objext" | \ *" eth-linux.$ac_objext" | \ "eth-linux.$ac_objext "* | \ *" eth-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-linux.$ac_objext" ;; esac elif test "$ac_cv_header_net_raw_h" = yes ; then case $LIBOBJS in "eth-snoop.$ac_objext" | \ *" eth-snoop.$ac_objext" | \ "eth-snoop.$ac_objext "* | \ *" eth-snoop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-snoop.$ac_objext" ;; esac elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then case $LIBOBJS in "eth-ndd.$ac_objext" | \ *" eth-ndd.$ac_objext" | \ "eth-ndd.$ac_objext "* | \ *" eth-ndd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-ndd.$ac_objext" ;; esac elif test "$ac_cv_header_sys_dlpi_h" = yes || \ test "$ac_cv_header_sys_dlpihdr_h" = yes ; then case $LIBOBJS in "eth-dlpi.$ac_objext" | \ *" eth-dlpi.$ac_objext" | \ "eth-dlpi.$ac_objext "* | \ *" eth-dlpi.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-dlpi.$ac_objext" ;; esac else case $LIBOBJS in "eth-none.$ac_objext" | \ *" eth-none.$ac_objext" | \ "eth-none.$ac_objext "* | \ *" eth-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "fw-pktfilter.$ac_objext" | \ *" fw-pktfilter.$ac_objext" | \ "fw-pktfilter.$ac_objext "* | \ *" fw-pktfilter.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-pktfilter.$ac_objext" ;; esac elif test "$ac_cv_header_net_pfvar_h" = yes ; then case $LIBOBJS in "fw-pf.$ac_objext" | \ *" fw-pf.$ac_objext" | \ "fw-pf.$ac_objext "* | \ *" fw-pf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-pf.$ac_objext" ;; esac elif test "$ac_cv_header_netinet_ip_fw_h" = yes ; then case "$host_os" in *freebsd5*) case $LIBOBJS in "fw-none.$ac_objext" | \ *" fw-none.$ac_objext" | \ "fw-none.$ac_objext "* | \ *" fw-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-none.$ac_objext" ;; esac ;; *) case $LIBOBJS in "fw-ipfw.$ac_objext" | \ *" fw-ipfw.$ac_objext" | \ "fw-ipfw.$ac_objext "* | \ *" fw-ipfw.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipfw.$ac_objext" ;; esac ;; esac elif test "$ac_cv_header_netinet_ip_fil_h" = yes ; then case $LIBOBJS in "fw-ipf.$ac_objext" | \ *" fw-ipf.$ac_objext" | \ "fw-ipf.$ac_objext "* | \ *" fw-ipf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipf.$ac_objext" ;; esac elif test "$ac_cv_header_linux_ip_fw_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac elif test "$ac_cv_header_linux_ip_fwchains_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac elif test "$ac_cv_header_linux_netfilter_ipv4_ipchains_core_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac else case $LIBOBJS in "fw-none.$ac_objext" | \ *" fw-none.$ac_objext" | \ "fw-none.$ac_objext "* | \ *" fw-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "intf-win32.$ac_objext" | \ *" intf-win32.$ac_objext" | \ "intf-win32.$ac_objext "* | \ *" intf-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS intf-win32.$ac_objext" ;; esac else case $LIBOBJS in "intf.$ac_objext" | \ *" intf.$ac_objext" | \ "intf.$ac_objext "* | \ *" intf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS intf.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "ip-win32.$ac_objext" | \ *" ip-win32.$ac_objext" | \ "ip-win32.$ac_objext "* | \ *" ip-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_rawip_cooked" = yes ; then case $LIBOBJS in "ip-cooked.$ac_objext" | \ *" ip-cooked.$ac_objext" | \ "ip-cooked.$ac_objext "* | \ *" ip-cooked.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip-cooked.$ac_objext" ;; esac else case $LIBOBJS in "ip.$ac_objext" | \ *" ip.$ac_objext" | \ "ip.$ac_objext "* | \ *" ip.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "route-win32.$ac_objext" | \ *" route-win32.$ac_objext" | \ "route-win32.$ac_objext "* | \ *" route-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then case $LIBOBJS in "route-bsd.$ac_objext" | \ *" route-bsd.$ac_objext" | \ "route-bsd.$ac_objext "* | \ *" route-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-bsd.$ac_objext" ;; esac elif test "$ac_cv_dnet_linux_procfs" = yes ; then case $LIBOBJS in "route-linux.$ac_objext" | \ *" route-linux.$ac_objext" | \ "route-linux.$ac_objext "* | \ *" route-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-linux.$ac_objext" ;; esac elif test "$ac_cv_header_hpsecurity_h" = yes ; then case $LIBOBJS in "route-hpux.$ac_objext" | \ *" route-hpux.$ac_objext" | \ "route-hpux.$ac_objext "* | \ *" route-hpux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-hpux.$ac_objext" ;; esac else case $LIBOBJS in "route-none.$ac_objext" | \ *" route-none.$ac_objext" | \ "route-none.$ac_objext "* | \ *" route-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-none.$ac_objext" ;; esac fi if test "$ac_cv_header_linux_if_tun_h" = yes ; then case $LIBOBJS in "tun-linux.$ac_objext" | \ *" tun-linux.$ac_objext" | \ "tun-linux.$ac_objext "* | \ *" tun-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-linux.$ac_objext" ;; esac elif test "$ac_cv_header_net_if_tun_h" = yes ; then if test "$ac_cv_header_stropts_h" = yes ; then case $LIBOBJS in "tun-solaris.$ac_objext" | \ *" tun-solaris.$ac_objext" | \ "tun-solaris.$ac_objext "* | \ *" tun-solaris.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-solaris.$ac_objext" ;; esac else case $LIBOBJS in "tun-bsd.$ac_objext" | \ *" tun-bsd.$ac_objext" | \ "tun-bsd.$ac_objext "* | \ *" tun-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-bsd.$ac_objext" ;; esac fi elif test -c "/dev/tun0" ; then case $LIBOBJS in "tun-bsd.$ac_objext" | \ *" tun-bsd.$ac_objext" | \ "tun-bsd.$ac_objext "* | \ *" tun-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-bsd.$ac_objext" ;; esac else case $LIBOBJS in "tun-none.$ac_objext" | \ *" tun-none.$ac_objext" | \ "tun-none.$ac_objext "* | \ *" tun-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-none.$ac_objext" ;; esac fi ac_config_files="$ac_config_files Makefile dnet-config include/Makefile include/dnet/Makefile man/Makefile src/Makefile python/Makefile python/setup.py test/Makefile test/check/Makefile test/dnet/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PYTHON_TRUE}" && test -z "${PYTHON_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${TCL_TRUE}" && test -z "${TCL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_CHECK_TRUE}" && test -z "${HAVE_CHECK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_CHECK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_CHECK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "dnet-config" ) CONFIG_FILES="$CONFIG_FILES dnet-config" ;; "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/dnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/dnet/Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "python/Makefile" ) CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; "python/setup.py" ) CONFIG_FILES="$CONFIG_FILES python/setup.py" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/check/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/check/Makefile" ;; "test/dnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/dnet/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@ac_aux_dir@,$ac_aux_dir,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@PYTHON@,$PYTHON,;t t s,@TCLINC@,$TCLINC,;t t s,@TCLLIB@,$TCLLIB,;t t s,@PYTHON_TRUE@,$PYTHON_TRUE,;t t s,@PYTHON_FALSE@,$PYTHON_FALSE,;t t s,@TCL_TRUE@,$TCL_TRUE,;t t s,@TCL_FALSE@,$TCL_FALSE,;t t s,@CHECKINC@,$CHECKINC,;t t s,@CHECKLIB@,$CHECKLIB,;t t s,@HAVE_CHECK_TRUE@,$HAVE_CHECK_TRUE,;t t s,@HAVE_CHECK_FALSE@,$HAVE_CHECK_FALSE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Run the commands associated with the file. case $ac_file in include/config.h ) # update the timestamp echo 'timestamp for include/config.h' >"include/stamp-h1" ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; default ) chmod 755 dnet-config ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi libdnet-1.12/configure.in0000644000076500007650000002111510554377551016553 0ustar dugsongdugsong00000000000000dnl dnl configure.in dnl dnl Copyright (c) 2000 Dug Song dnl dnl $Id: configure.in 638 2007-01-20 11:39:21Z dugsong $ AC_INIT(include/dnet.h) AC_CONFIG_AUX_DIR(config) AC_SUBST(ac_aux_dir) AM_INIT_AUTOMAKE(libdnet, 1.12) AM_CONFIG_HEADER(include/config.h) dnl XXX - stop the insanity!@#$ AM_MAINTAINER_MODE dnl Check for system type. dnl XXX - we do this to qualify our later feature checks, since some dnl systems claim to support multiple features, but are quite b0rked. AC_CANONICAL_HOST dnl XXX - spoof AC_CYGWIN case "$host_os" in *cygwin*) CYGWIN=yes;; *) CYGWIN=no;; esac dnl Initialize prefix. if test "$prefix" = "NONE"; then prefix="/usr/local" fi dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL dnl Checks for Python. dnl XXX - use AM_PATH_PYTHON after automake upgrade AC_MSG_CHECKING(for Python) AC_ARG_WITH(python, [ --with-python=DIR build Python module (using python in DIR)], [ case "$withval" in yes) AC_MSG_RESULT(yes) PYTHON="python" ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT($withval) for subdir in . bin; do if test -x $withval/$subdir/python; then owd=`pwd` if cd $withval/$subdir; then withval=`pwd`; cd $owd; fi PYTHON="$withval/python" break fi done if test "x$PYTHON" = "x"; then AC_ERROR(python not found in $withval) fi ;; esac ]) AC_SUBST(PYTHON) AC_SUBST(TCLINC) AC_SUBST(TCLLIB) AM_CONDITIONAL(PYTHON, [test "x$PYTHON" != "x"]) AM_CONDITIONAL(TCL, [test "x$TCLINC" != "x"]) dnl XXX - stupid IRIX cpp if test -r /usr/include/sgidefs.h ; then CPPFLAGS="$CPPFLAGS -D__sgi" fi dnl XXX - we need MingW32 under Cygwin for win32 if test "$CYGWIN" = yes ; then if test -d /usr/include/mingw ; then CPPFLAGS="$CPPFLAGS -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin" AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define for faster code generation.]) AC_CHECK_LIB(ws2_32, main) AC_CHECK_LIB(iphlpapi, main) AC_DEFINE(snprintf, _snprintf, [Use MingW32's internal snprintf]) else AC_MSG_ERROR([need MingW32 package to build under Cygwin]) fi AC_MSG_CHECKING(for WinPcap developer's pack) AC_ARG_WITH(wpdpack, [ --with-wpdpack=DIR use WinPcap developer's pack in DIR], [ AC_MSG_RESULT($withval) if test -f $withval/include/packet32.h -a -f $withval/lib/packet.lib; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CFLAGS="$CFLAGS -I$withval/include" LIBS="$LIBS -L$withval/lib -lpacket" else AC_MSG_ERROR(packet32.h or packet.lib not found in $withval) fi ], [ for dir in ${prefix} ${HOME}/WPdpack ; do if test -f ${dir}/include/packet32.h -a -f ${dir}/lib/packet.lib; then CFLAGS="$CFLAGS -I${dir}/include" LIBS="$LIBS -L${dir}/lib -lpacket" have_pcap=yes break; fi done if test "$have_pcap" != yes; then AC_MSG_ERROR(WinPcap developer's pack not found) fi AC_MSG_RESULT(yes) ]) fi dnl Checks for libraries. if test "$CYGWIN" != yes ; then AC_LBL_LIBRARY_NET AC_CHECK_LIB(nm, open_mib) fi dnl Checks for Check. AC_MSG_CHECKING(for Check) AC_ARG_WITH(check, [ --with-check=DIR use Check (http://check.sf.net) in DIR], [ case "$withval" in yes|no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT($withval) if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/include" CHECKLIB="-L$withval/lib -lcheck" elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/src" CHECKLIB="-L$withval/src -lcheck" else AC_ERROR(check.h or libcheck.a not found in $withval) fi ;; esac ], [ if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then CHECKINC="-I${prefix}/include" CHECKLIB="-L${prefix}/lib -lcheck" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) AC_SUBST(CHECKINC) AC_SUBST(CHECKLIB) AM_CONDITIONAL(HAVE_CHECK, test "x$CHECKLIB" != "x") dnl Checks for header files. AC_HEADER_STDC if test "$CYGWIN" = yes ; then AC_CHECK_HEADERS(Iphlpapi.h winsock2.h) else AC_CHECK_HEADERS(fcntl.h unistd.h) AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h \ sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h \ sys/sysctl.h sys/time.h) AC_CHECK_HEADERS(net/bpf.h net/if.h net/if_var.h \ net/if_arp.h net/if_dl.h net/pfilt.h \ net/pfvar.h net/radix.h net/raw.h net/route.h netinet/in_var.h \ net/if_tun.h linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h \ linux/ip_fwchains.h linux/netfilter_ipv4/ipchains_core.h) AC_CHECK_HEADERS(ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h \ netinet/ip_compat.h ip_fil.h netinet/ip_fil.h) AC_CHECK_HEADERS(hpsecurity.h stropts.h) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_DNET_SOCKADDR_IN6 if test "$ac_cv_header_sys_socket_h" = yes ; then AC_DNET_SOCKADDR_SA_LEN fi if test "$ac_cv_header_net_if_arp_h" = yes ; then AC_DNET_ARPREQ_ARP_DEV fi if test "$ac_cv_header_net_route_h" = yes ; then AC_DNET_ROUTE_RT_MSGHDR fi AC_PROG_GCC_TRADITIONAL if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi dnl Checks for library functions. AC_FUNC_MEMCMP AC_REPLACE_FUNCS(err strlcat strlcpy strsep) dnl Checks for other system-specific jonks. if test "$CYGWIN" != yes ; then AC_DNET_BSD_BPF AC_DNET_LINUX_PROCFS AC_DNET_LINUX_PF_PACKET AC_DNET_STREAMS_MIB2 AC_DNET_STREAMS_ROUTE AC_DNET_IOCTL_ARP AC_DNET_RAWIP_HOST_OFFLEN AC_DNET_RAWIP_COOKED fi dnl Check for arp interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([arp-win32]) elif test "$ac_cv_dnet_ioctl_arp" = yes ; then AC_LIBOBJ([arp-ioctl]) elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then AC_LIBOBJ([arp-bsd]) else AC_LIBOBJ([arp-none]) fi dnl Check for Ethernet interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([eth-win32]) elif test "$ac_cv_header_net_pfilt_h" = yes ; then AC_LIBOBJ([eth-pfilt]) elif test "$ac_cv_dnet_bsd_bpf" = yes ; then AC_LIBOBJ([eth-bsd]) elif test "$ac_cv_dnet_linux_pf_packet" = yes ; then AC_LIBOBJ([eth-linux]) elif test "$ac_cv_header_net_raw_h" = yes ; then AC_LIBOBJ([eth-snoop]) elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then AC_LIBOBJ([eth-ndd]) elif test "$ac_cv_header_sys_dlpi_h" = yes || \ test "$ac_cv_header_sys_dlpihdr_h" = yes ; then AC_LIBOBJ([eth-dlpi]) else AC_LIBOBJ([eth-none]) fi dnl Check for firewall interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([fw-pktfilter]) elif test "$ac_cv_header_net_pfvar_h" = yes ; then AC_LIBOBJ([fw-pf]) elif test "$ac_cv_header_netinet_ip_fw_h" = yes ; then dnl XXX - ipfw2 support later... case "$host_os" in *freebsd5*) AC_LIBOBJ([fw-none]) ;; *) AC_LIBOBJ([fw-ipfw]) ;; esac elif test "$ac_cv_header_netinet_ip_fil_h" = yes ; then AC_LIBOBJ([fw-ipf]) elif test "$ac_cv_header_linux_ip_fw_h" = yes ; then AC_LIBOBJ([fw-ipchains]) elif test "$ac_cv_header_linux_ip_fwchains_h" = yes ; then AC_LIBOBJ([fw-ipchains]) elif test "$ac_cv_header_linux_netfilter_ipv4_ipchains_core_h" = yes ; then AC_LIBOBJ([fw-ipchains]) else AC_LIBOBJ([fw-none]) fi dnl Check for network interface interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([intf-win32]) else AC_LIBOBJ([intf]) fi dnl Check for raw IP interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([ip-win32]) elif test "$ac_cv_dnet_rawip_cooked" = yes ; then AC_LIBOBJ([ip-cooked]) else AC_LIBOBJ([ip]) fi dnl Check for routing interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([route-win32]) elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then AC_LIBOBJ([route-bsd]) elif test "$ac_cv_dnet_linux_procfs" = yes ; then AC_LIBOBJ([route-linux]) elif test "$ac_cv_header_hpsecurity_h" = yes ; then AC_LIBOBJ([route-hpux]) else AC_LIBOBJ([route-none]) fi dnl Check for tun interface. if test "$ac_cv_header_linux_if_tun_h" = yes ; then AC_LIBOBJ([tun-linux]) elif test "$ac_cv_header_net_if_tun_h" = yes ; then if test "$ac_cv_header_stropts_h" = yes ; then AC_LIBOBJ([tun-solaris]) else AC_LIBOBJ([tun-bsd]) fi elif test -c "/dev/tun0" ; then AC_LIBOBJ([tun-bsd]) else AC_LIBOBJ([tun-none]) fi AC_OUTPUT([Makefile dnet-config include/Makefile include/dnet/Makefile man/Makefile src/Makefile python/Makefile python/setup.py test/Makefile test/check/Makefile test/dnet/Makefile], [chmod 755 dnet-config]) libdnet-1.12/dnet-config.in0000644000076500007650000000132707363700734016767 0ustar dugsongdugsong00000000000000#!/bin/sh # # $Id: dnet-config.in 91 2001-10-19 01:29:00Z dugsong $ prefix=@prefix@ exec_prefix=@prefix@ usage() { cat <&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --version) echo @VERSION@ ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_cflags" = "yes"; then echo -I@includedir@ fi if test "$echo_libs" = "yes"; then echo -L@libdir@ -ldnet @LIBS@ fi libdnet-1.12/include/0000755000076500007650000000000010554406376015663 5ustar dugsongdugsong00000000000000libdnet-1.12/include/config.h.in0000644000076500007650000001714110363627052017704 0ustar dugsongdugsong00000000000000/* include/config.h.in. Generated from configure.in by autoheader. */ /* Define if arpreq struct has arp_dev. */ #undef HAVE_ARPREQ_ARP_DEV /* Define if you have the Berkeley Packet Filter. */ #undef HAVE_BSD_BPF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `err' function. */ #undef HAVE_ERR /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_HPSECURITY_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have arp(7) ioctls. */ #undef HAVE_IOCTL_ARP /* Define to 1 if you have the header file. */ #undef HAVE_IPHLPAPI_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_FIL_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_FIL_H /* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ #undef HAVE_LIBIPHLPAPI /* Define to 1 if you have the `nm' library (-lnm). */ #undef HAVE_LIBNM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `str' library (-lstr). */ #undef HAVE_LIBSTR /* 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_LINUX_IF_TUN_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IP_FWCHAINS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IP_FW_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H /* Define if you have Linux PF_PACKET sockets. */ #undef HAVE_LINUX_PF_PACKET /* Define if you have the Linux /proc filesystem. */ #undef HAVE_LINUX_PROCFS /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_FIL_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_FIL_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_NET_BPF_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_ARP_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_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_TUN_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFILT_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFVAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_RADIX_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_RAW_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_ROUTE_H /* Define if you have cooked raw IP sockets. */ #undef HAVE_RAWIP_COOKED /* Define if raw IP sockets require host byte ordering for ip_off, ip_len. */ #undef HAVE_RAWIP_HOST_OFFLEN /* Define if has rt_msghdr struct. */ #undef HAVE_ROUTE_RT_MSGHDR /* Define if has sockaddr_in6 struct. */ #undef HAVE_SOCKADDR_IN6 /* Define if sockaddr struct has sa_len. */ #undef HAVE_SOCKADDR_SA_LEN /* 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 if you have SNMP MIB2 STREAMS. */ #undef HAVE_STREAMS_MIB2 /* Define if you have route(7) STREAMS. */ #undef HAVE_STREAMS_ROUTE /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BUFMOD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPIHDR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPI_EXT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPI_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_MIB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_NDD_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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 the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define for faster code generation. */ #undef WIN32_LEAN_AND_MEAN /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* Use MingW32's internal snprintf */ #undef snprintf #include #ifdef HAVE_WINSOCK2_H # include # include #endif #ifdef __svr4__ # define BSD_COMP 1 #endif #if defined(__osf__) && !defined(_SOCKADDR_LEN) # define _SOCKADDR_LEN 1 #endif #ifndef HAVE_INET_PTON int inet_pton(int, const char *, void *); #endif #ifndef HAVE_STRLCAT int strlcat(char *, const char *, int); #endif #ifndef HAVE_STRLCPY int strlcpy(char *, const char *, int); #endif #ifndef HAVE_STRSEP char *strsep(char **, const char *); #endif libdnet-1.12/include/dnet/0000755000076500007650000000000010554406375016614 5ustar dugsongdugsong00000000000000libdnet-1.12/include/dnet/addr.h0000644000076500007650000000333107627304667017707 0ustar dugsongdugsong00000000000000/* * addr.h * * Network address operations. * * Copyright (c) 2000 Dug Song * * $Id: addr.h 404 2003-02-27 03:44:55Z dugsong $ */ #ifndef DNET_ADDR_H #define DNET_ADDR_H #define ADDR_TYPE_NONE 0 /* No address set */ #define ADDR_TYPE_ETH 1 /* Ethernet */ #define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ #define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ struct addr { uint16_t addr_type; uint16_t addr_bits; union { eth_addr_t __eth; ip_addr_t __ip; ip6_addr_t __ip6; uint8_t __data8[16]; uint16_t __data16[8]; uint32_t __data32[4]; } __addr_u; }; #define addr_eth __addr_u.__eth #define addr_ip __addr_u.__ip #define addr_ip6 __addr_u.__ip6 #define addr_data8 __addr_u.__data8 #define addr_data16 __addr_u.__data16 #define addr_data32 __addr_u.__data32 #define addr_pack(addr, type, bits, data, len) do { \ (addr)->addr_type = type; \ (addr)->addr_bits = bits; \ memmove((addr)->addr_data8, (char *)data, len); \ } while (0) __BEGIN_DECLS int addr_cmp(const struct addr *a, const struct addr *b); int addr_bcast(const struct addr *a, struct addr *b); int addr_net(const struct addr *a, struct addr *b); char *addr_ntop(const struct addr *src, char *dst, size_t size); int addr_pton(const char *src, struct addr *dst); char *addr_ntoa(const struct addr *a); #define addr_aton addr_pton int addr_ntos(const struct addr *a, struct sockaddr *sa); int addr_ston(const struct sockaddr *sa, struct addr *a); int addr_btos(uint16_t bits, struct sockaddr *sa); int addr_stob(const struct sockaddr *sa, uint16_t *bits); int addr_btom(uint16_t bits, void *mask, size_t size); int addr_mtob(const void *mask, size_t size, uint16_t *bits); __END_DECLS #endif /* DNET_ADDR_H */ libdnet-1.12/include/dnet/arp.h0000644000076500007650000000532707635133306017553 0ustar dugsongdugsong00000000000000/* * arp.h * * Address Resolution Protocol. * RFC 826 * * Copyright (c) 2000 Dug Song * * $Id: arp.h 416 2003-03-16 17:39:18Z dugsong $ */ #ifndef DNET_ARP_H #define DNET_ARP_H #define ARP_HDR_LEN 8 /* base ARP header length */ #define ARP_ETHIP_LEN 20 /* base ARP message length */ #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * ARP header */ struct arp_hdr { uint16_t ar_hrd; /* format of hardware address */ uint16_t ar_pro; /* format of protocol address */ uint8_t ar_hln; /* length of hardware address (ETH_ADDR_LEN) */ uint8_t ar_pln; /* length of protocol address (IP_ADDR_LEN) */ uint16_t ar_op; /* operation */ }; /* * Hardware address format */ #define ARP_HRD_ETH 0x0001 /* ethernet hardware */ #define ARP_HRD_IEEE802 0x0006 /* IEEE 802 hardware */ /* * Protocol address format */ #define ARP_PRO_IP 0x0800 /* IP protocol */ /* * ARP operation */ #define ARP_OP_REQUEST 1 /* request to resolve ha given pa */ #define ARP_OP_REPLY 2 /* response giving hardware address */ #define ARP_OP_REVREQUEST 3 /* request to resolve pa given ha */ #define ARP_OP_REVREPLY 4 /* response giving protocol address */ /* * Ethernet/IP ARP message */ struct arp_ethip { uint8_t ar_sha[ETH_ADDR_LEN]; /* sender hardware address */ uint8_t ar_spa[IP_ADDR_LEN]; /* sender protocol address */ uint8_t ar_tha[ETH_ADDR_LEN]; /* target hardware address */ uint8_t ar_tpa[IP_ADDR_LEN]; /* target protocol address */ }; /* * ARP cache entry */ struct arp_entry { struct addr arp_pa; /* protocol address */ struct addr arp_ha; /* hardware address */ }; #ifndef __GNUC__ # pragma pack() #endif #define arp_pack_hdr_ethip(hdr, op, sha, spa, tha, tpa) do { \ struct arp_hdr *pack_arp_p = (struct arp_hdr *)(hdr); \ struct arp_ethip *pack_ethip_p = (struct arp_ethip *) \ ((uint8_t *)(hdr) + ARP_HDR_LEN); \ pack_arp_p->ar_hrd = htons(ARP_HRD_ETH); \ pack_arp_p->ar_pro = htons(ARP_PRO_IP); \ pack_arp_p->ar_hln = ETH_ADDR_LEN; \ pack_arp_p->ar_pln = IP_ADDR_LEN; \ pack_arp_p->ar_op = htons(op); \ memmove(pack_ethip_p->ar_sha, &(sha), ETH_ADDR_LEN); \ memmove(pack_ethip_p->ar_spa, &(spa), IP_ADDR_LEN); \ memmove(pack_ethip_p->ar_tha, &(tha), ETH_ADDR_LEN); \ memmove(pack_ethip_p->ar_tpa, &(tpa), IP_ADDR_LEN); \ } while (0) typedef struct arp_handle arp_t; typedef int (*arp_handler)(const struct arp_entry *entry, void *arg); __BEGIN_DECLS arp_t *arp_open(void); int arp_add(arp_t *arp, const struct arp_entry *entry); int arp_delete(arp_t *arp, const struct arp_entry *entry); int arp_get(arp_t *arp, struct arp_entry *entry); int arp_loop(arp_t *arp, arp_handler callback, void *arg); arp_t *arp_close(arp_t *arp); __END_DECLS #endif /* DNET_ARP_H */ libdnet-1.12/include/dnet/blob.h0000644000076500007650000000266207453212304017700 0ustar dugsongdugsong00000000000000/* * blob.h * * Binary blob handling. * * Copyright (c) 2002 Dug Song * * $Id: blob.h 334 2002-04-05 03:06:44Z dugsong $ */ #ifndef DNET_BLOB_H #define DNET_BLOB_H typedef struct blob { u_char *base; /* start of data */ int off; /* offset into data */ int end; /* end of data */ int size; /* size of allocation */ } blob_t; __BEGIN_DECLS blob_t *blob_new(void); int blob_read(blob_t *b, void *buf, int len); int blob_write(blob_t *b, const void *buf, int len); int blob_seek(blob_t *b, int off, int whence); #define blob_skip(b, l) blob_seek(b, l, SEEK_CUR) #define blob_rewind(b) blob_seek(b, 0, SEEK_SET) #define blob_offset(b) ((b)->off) #define blob_left(b) ((b)->end - (b)->off) int blob_index(blob_t *b, const void *buf, int len); int blob_rindex(blob_t *b, const void *buf, int len); int blob_pack(blob_t *b, const char *fmt, ...); int blob_unpack(blob_t *b, const char *fmt, ...); int blob_insert(blob_t *b, const void *buf, int len); int blob_delete(blob_t *b, void *buf, int len); int blob_print(blob_t *b, char *style, int len); blob_t *blob_free(blob_t *b); int blob_register_alloc(size_t size, void *(*bmalloc)(size_t), void (*bfree)(void *), void *(*brealloc)(void *, size_t)); #ifdef va_start typedef int (*blob_fmt_cb)(int pack, int len, blob_t *b, va_list *arg); int blob_register_pack(char c, blob_fmt_cb fmt_cb); #endif __END_DECLS #endif /* DNET_BLOB_H */ libdnet-1.12/include/dnet/eth.h0000644000076500007650000000446110175535200017537 0ustar dugsongdugsong00000000000000/* * eth.h * * Ethernet. * * Copyright (c) 2000 Dug Song * * $Id: eth.h 547 2005-01-25 21:30:40Z dugsong $ */ #ifndef DNET_ETH_H #define DNET_ETH_H #define ETH_ADDR_LEN 6 #define ETH_ADDR_BITS 48 #define ETH_TYPE_LEN 2 #define ETH_CRC_LEN 4 #define ETH_HDR_LEN 14 #define ETH_LEN_MIN 64 /* minimum frame length with CRC */ #define ETH_LEN_MAX 1518 /* maximum frame length with CRC */ #define ETH_MTU (ETH_LEN_MAX - ETH_HDR_LEN - ETH_CRC_LEN) #define ETH_MIN (ETH_LEN_MIN - ETH_HDR_LEN - ETH_CRC_LEN) typedef struct eth_addr { uint8_t data[ETH_ADDR_LEN]; } eth_addr_t; struct eth_hdr { eth_addr_t eth_dst; /* destination address */ eth_addr_t eth_src; /* source address */ uint16_t eth_type; /* payload type */ }; /* * Ethernet payload types - http://standards.ieee.org/regauth/ethertype */ #define ETH_TYPE_PUP 0x0200 /* PUP protocol */ #define ETH_TYPE_IP 0x0800 /* IP protocol */ #define ETH_TYPE_ARP 0x0806 /* address resolution protocol */ #define ETH_TYPE_REVARP 0x8035 /* reverse addr resolution protocol */ #define ETH_TYPE_8021Q 0x8100 /* IEEE 802.1Q VLAN tagging */ #define ETH_TYPE_IPV6 0x86DD /* IPv6 protocol */ #define ETH_TYPE_MPLS 0x8847 /* MPLS */ #define ETH_TYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETH_TYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */ #define ETH_TYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETH_TYPE_LOOPBACK 0x9000 /* used to test interfaces */ #define ETH_IS_MULTICAST(ea) (*(ea) & 0x01) /* is address mcast/bcast? */ #define ETH_ADDR_BROADCAST "\xff\xff\xff\xff\xff\xff" #define eth_pack_hdr(h, dst, src, type) do { \ struct eth_hdr *eth_pack_p = (struct eth_hdr *)(h); \ memmove(ð_pack_p->eth_dst, &(dst), ETH_ADDR_LEN); \ memmove(ð_pack_p->eth_src, &(src), ETH_ADDR_LEN); \ eth_pack_p->eth_type = htons(type); \ } while (0) typedef struct eth_handle eth_t; __BEGIN_DECLS eth_t *eth_open(const char *device); int eth_get(eth_t *e, eth_addr_t *ea); int eth_set(eth_t *e, const eth_addr_t *ea); ssize_t eth_send(eth_t *e, const void *buf, size_t len); eth_t *eth_close(eth_t *e); char *eth_ntop(const eth_addr_t *eth, char *dst, size_t len); int eth_pton(const char *src, eth_addr_t *dst); char *eth_ntoa(const eth_addr_t *eth); #define eth_aton eth_pton __END_DECLS #endif /* DNET_ETH_H */ libdnet-1.12/include/dnet/fw.h0000644000076500007650000000273607576526534017423 0ustar dugsongdugsong00000000000000/* * fw.h * * Network firewalling operations. * * Copyright (c) 2001 Dug Song * * $Id: fw.h 394 2002-12-14 04:02:36Z dugsong $ */ #ifndef DNET_FW_H #define DNET_FW_H struct fw_rule { char fw_device[INTF_NAME_LEN]; /* interface name */ uint8_t fw_op; /* operation */ uint8_t fw_dir; /* direction */ uint8_t fw_proto; /* IP protocol */ struct addr fw_src; /* src address / net */ struct addr fw_dst; /* dst address / net */ uint16_t fw_sport[2]; /* range / ICMP type */ uint16_t fw_dport[2]; /* range / ICMP code */ }; #define FW_OP_ALLOW 1 #define FW_OP_BLOCK 2 #define FW_DIR_IN 1 #define FW_DIR_OUT 2 #define fw_pack_rule(rule, dev, op, dir, p, s, d, sp1, sp2, dp1, dp2) \ do { \ strlcpy((rule)->fw_device, dev, sizeof((rule)->fw_device)); \ (rule)->fw_op = op; (rule)->fw_dir = dir; \ (rule)->fw_proto = p; \ memmove(&(rule)->fw_src, &(s), sizeof((rule)->fw_src)); \ memmove(&(rule)->fw_dst, &(d), sizeof((rule)->fw_dst)); \ (rule)->fw_sport[0] = sp1; (rule)->fw_sport[1] = sp2; \ (rule)->fw_dport[0] = dp1; (rule)->fw_dport[1] = dp2; \ } while (0) typedef struct fw_handle fw_t; typedef int (*fw_handler)(const struct fw_rule *rule, void *arg); __BEGIN_DECLS fw_t *fw_open(void); int fw_add(fw_t *f, const struct fw_rule *rule); int fw_delete(fw_t *f, const struct fw_rule *rule); int fw_loop(fw_t *f, fw_handler callback, void *arg); fw_t *fw_close(fw_t *f); __END_DECLS #endif /* DNET_FW_H */ libdnet-1.12/include/dnet/icmp.h0000644000076500007650000002230407635133306017713 0ustar dugsongdugsong00000000000000/* * icmp.h * * Internet Control Message Protocol. * RFC 792, 950, 1256, 1393, 1475, 2002, 2521 * * Copyright (c) 2000 Dug Song * * $Id: icmp.h 416 2003-03-16 17:39:18Z dugsong $ */ #ifndef DNET_ICMP_H #define DNET_ICMP_H #define ICMP_HDR_LEN 4 /* base ICMP header length */ #define ICMP_LEN_MIN 8 /* minimum ICMP message size, with header */ #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * ICMP header */ struct icmp_hdr { uint8_t icmp_type; /* type of message, see below */ uint8_t icmp_code; /* type sub code */ uint16_t icmp_cksum; /* ones complement cksum of struct */ }; /* * Types (icmp_type) and codes (icmp_code) - * http://www.iana.org/assignments/icmp-parameters */ #define ICMP_CODE_NONE 0 /* for types without codes */ #define ICMP_ECHOREPLY 0 /* echo reply */ #define ICMP_UNREACH 3 /* dest unreachable, codes: */ #define ICMP_UNREACH_NET 0 /* bad net */ #define ICMP_UNREACH_HOST 1 /* bad host */ #define ICMP_UNREACH_PROTO 2 /* bad protocol */ #define ICMP_UNREACH_PORT 3 /* bad port */ #define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ #define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ #define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ #define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ #define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ #define ICMP_UNREACH_NET_PROHIB 9 /* for crypto devs */ #define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ #define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ #define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ #define ICMP_UNREACH_FILTER_PROHIB 13 /* prohibited access */ #define ICMP_UNREACH_HOST_PRECEDENCE 14 /* precedence error */ #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* precedence cutoff */ #define ICMP_SRCQUENCH 4 /* packet lost, slow down */ #define ICMP_REDIRECT 5 /* shorter route, codes: */ #define ICMP_REDIRECT_NET 0 /* for network */ #define ICMP_REDIRECT_HOST 1 /* for host */ #define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ #define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ #define ICMP_ALTHOSTADDR 6 /* alternate host address */ #define ICMP_ECHO 8 /* echo service */ #define ICMP_RTRADVERT 9 /* router advertise, codes: */ #define ICMP_RTRADVERT_NORMAL 0 /* normal */ #define ICMP_RTRADVERT_NOROUTE_COMMON 16 /* selective routing */ #define ICMP_RTRSOLICIT 10 /* router solicitation */ #define ICMP_TIMEXCEED 11 /* time exceeded, code: */ #define ICMP_TIMEXCEED_INTRANS 0 /* ttl==0 in transit */ #define ICMP_TIMEXCEED_REASS 1 /* ttl==0 in reass */ #define ICMP_PARAMPROB 12 /* ip header bad */ #define ICMP_PARAMPROB_ERRATPTR 0 /* req. opt. absent */ #define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ #define ICMP_PARAMPROB_LENGTH 2 /* bad length */ #define ICMP_TSTAMP 13 /* timestamp request */ #define ICMP_TSTAMPREPLY 14 /* timestamp reply */ #define ICMP_INFO 15 /* information request */ #define ICMP_INFOREPLY 16 /* information reply */ #define ICMP_MASK 17 /* address mask request */ #define ICMP_MASKREPLY 18 /* address mask reply */ #define ICMP_TRACEROUTE 30 /* traceroute */ #define ICMP_DATACONVERR 31 /* data conversion error */ #define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ #define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ #define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ #define ICMP_MOBILE_REG 35 /* mobile registration req */ #define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ #define ICMP_DNS 37 /* domain name request */ #define ICMP_DNSREPLY 38 /* domain name reply */ #define ICMP_SKIP 39 /* SKIP */ #define ICMP_PHOTURIS 40 /* Photuris */ #define ICMP_PHOTURIS_UNKNOWN_INDEX 0 /* unknown sec index */ #define ICMP_PHOTURIS_AUTH_FAILED 1 /* auth failed */ #define ICMP_PHOTURIS_DECOMPRESS_FAILED 2 /* decompress failed */ #define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ #define ICMP_PHOTURIS_NEED_AUTHN 4 /* no authentication */ #define ICMP_PHOTURIS_NEED_AUTHZ 5 /* no authorization */ #define ICMP_TYPE_MAX 40 #define ICMP_INFOTYPE(type) \ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ (type) == ICMP_RTRADVERT || (type) == ICMP_RTRSOLICIT || \ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ (type) == ICMP_INFO || (type) == ICMP_INFOREPLY || \ (type) == ICMP_MASK || (type) == ICMP_MASKREPLY) /* * Echo message data */ struct icmp_msg_echo { uint16_t icmp_id; uint16_t icmp_seq; uint8_t icmp_data __flexarr; /* optional data */ }; /* * Fragmentation-needed (unreachable) message data */ struct icmp_msg_needfrag { uint16_t icmp_void; /* must be zero */ uint16_t icmp_mtu; /* MTU of next-hop network */ uint8_t icmp_ip __flexarr; /* IP hdr + 8 bytes of pkt */ }; /* * Unreachable, source quench, redirect, time exceeded, * parameter problem message data */ struct icmp_msg_quote { uint32_t icmp_void; /* must be zero */ #define icmp_gwaddr icmp_void /* router IP address to use */ #define icmp_pptr icmp_void /* ptr to bad octet field */ uint8_t icmp_ip __flexarr; /* IP hdr + 8 bytes of pkt */ }; /* * Router advertisement message data, RFC 1256 */ struct icmp_msg_rtradvert { uint8_t icmp_num_addrs; /* # of address / pref pairs */ uint8_t icmp_wpa; /* words / address == 2 */ uint16_t icmp_lifetime; /* route lifetime in seconds */ struct icmp_msg_rtr_data { uint32_t icmp_void; #define icmp_gwaddr icmp_void /* router IP address */ uint32_t icmp_pref; /* router preference (usu 0) */ } icmp_rtr __flexarr; /* variable # of routers */ }; #define ICMP_RTR_PREF_NODEFAULT 0x80000000 /* do not use as default gw */ /* * Timestamp message data */ struct icmp_msg_tstamp { uint32_t icmp_id; /* identifier */ uint32_t icmp_seq; /* sequence number */ uint32_t icmp_ts_orig; /* originate timestamp */ uint32_t icmp_ts_rx; /* receive timestamp */ uint32_t icmp_ts_tx; /* transmit timestamp */ }; /* * Address mask message data, RFC 950 */ struct icmp_msg_mask { uint32_t icmp_id; /* identifier */ uint32_t icmp_seq; /* sequence number */ uint32_t icmp_mask; /* address mask */ }; /* * Traceroute message data, RFC 1393, RFC 1812 */ struct icmp_msg_traceroute { uint16_t icmp_id; /* identifier */ uint16_t icmp_void; /* unused */ uint16_t icmp_ohc; /* outbound hop count */ uint16_t icmp_rhc; /* return hop count */ uint32_t icmp_speed; /* link speed, bytes/sec */ uint32_t icmp_mtu; /* MTU in bytes */ }; /* * Domain name reply message data, RFC 1788 */ struct icmp_msg_dnsreply { uint16_t icmp_id; /* identifier */ uint16_t icmp_seq; /* sequence number */ uint32_t icmp_ttl; /* time-to-live */ uint8_t icmp_names __flexarr; /* variable number of names */ }; /* * Generic identifier, sequence number data */ struct icmp_msg_idseq { uint16_t icmp_id; uint16_t icmp_seq; }; /* * ICMP message union */ union icmp_msg { struct icmp_msg_echo echo; /* ICMP_ECHO{REPLY} */ struct icmp_msg_quote unreach; /* ICMP_UNREACH */ struct icmp_msg_needfrag needfrag; /* ICMP_UNREACH_NEEDFRAG */ struct icmp_msg_quote srcquench; /* ICMP_SRCQUENCH */ struct icmp_msg_quote redirect; /* ICMP_REDIRECT (set to 0) */ uint32_t rtrsolicit; /* ICMP_RTRSOLICIT */ struct icmp_msg_rtradvert rtradvert; /* ICMP_RTRADVERT */ struct icmp_msg_quote timexceed; /* ICMP_TIMEXCEED */ struct icmp_msg_quote paramprob; /* ICMP_PARAMPROB */ struct icmp_msg_tstamp tstamp; /* ICMP_TSTAMP{REPLY} */ struct icmp_msg_idseq info; /* ICMP_INFO{REPLY} */ struct icmp_msg_mask mask; /* ICMP_MASK{REPLY} */ struct icmp_msg_traceroute traceroute; /* ICMP_TRACEROUTE */ struct icmp_msg_idseq dns; /* ICMP_DNS */ struct icmp_msg_dnsreply dnsreply; /* ICMP_DNSREPLY */ }; #ifndef __GNUC__ # pragma pack() #endif #define icmp_pack_hdr(hdr, type, code) do { \ struct icmp_hdr *icmp_pack_p = (struct icmp_hdr *)(hdr); \ icmp_pack_p->icmp_type = type; icmp_pack_p->icmp_code = code; \ } while (0) #define icmp_pack_hdr_echo(hdr, type, code, id, seq, data, len) do { \ struct icmp_msg_echo *echo_pack_p = (struct icmp_msg_echo *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ echo_pack_p->icmp_id = htons(id); \ echo_pack_p->icmp_seq = htons(seq); \ memmove(echo_pack_p->icmp_data, data, len); \ } while (0) #define icmp_pack_hdr_quote(hdr, type, code, word, pkt, len) do { \ struct icmp_msg_quote *quote_pack_p = (struct icmp_msg_quote *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ quote_pack_p->icmp_void = htonl(word); \ memmove(quote_pack_p->icmp_ip, pkt, len); \ } while (0) #define icmp_pack_hdr_mask(hdr, type, code, id, seq, mask) do { \ struct icmp_msg_mask *mask_pack_p = (struct icmp_msg_mask *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ mask_pack_p->icmp_id = htons(id); \ mask_pack_p->icmp_seq = htons(seq); \ mask_pack_p->icmp_mask = htonl(mask); \ } while (0) #define icmp_pack_hdr_needfrag(hdr, type, code, mtu, pkt, len) do { \ struct icmp_msg_needfrag *frag_pack_p = \ (struct icmp_msg_needfrag *)((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ frag_pack_p->icmp_void = 0; \ frag_pack_p->icmp_mtu = htons(mtu); \ memmove(frag_pack_p->icmp_ip, pkt, len); \ } while (0) #endif /* DNET_ICMP_H */ libdnet-1.12/include/dnet/intf.h0000644000076500007650000000424410000720425017706 0ustar dugsongdugsong00000000000000/* * intf.c * * Network interface operations. * * Copyright (c) 2000 Dug Song * * $Id: intf.h 478 2004-01-13 07:41:09Z dugsong $ */ #ifndef DNET_INTF_H #define DNET_INTF_H /* * Interface entry */ #define INTF_NAME_LEN 16 struct intf_entry { u_int intf_len; /* length of entry */ char intf_name[INTF_NAME_LEN]; /* interface name */ u_short intf_type; /* interface type (r/o) */ u_short intf_flags; /* interface flags */ u_int intf_mtu; /* interface MTU */ struct addr intf_addr; /* interface address */ struct addr intf_dst_addr; /* point-to-point dst */ struct addr intf_link_addr; /* link-layer address */ u_int intf_alias_num; /* number of aliases */ struct addr intf_alias_addrs __flexarr; /* array of aliases */ }; /* * MIB-II interface types - http://www.iana.org/assignments/ianaiftype-mib */ #define INTF_TYPE_OTHER 1 /* other */ #define INTF_TYPE_ETH 6 /* Ethernet */ #define INTF_TYPE_TOKENRING 9 /* Token Ring */ #define INTF_TYPE_FDDI 15 /* FDDI */ #define INTF_TYPE_PPP 23 /* Point-to-Point Protocol */ #define INTF_TYPE_LOOPBACK 24 /* software loopback */ #define INTF_TYPE_SLIP 28 /* Serial Line Interface Protocol */ #define INTF_TYPE_TUN 53 /* proprietary virtual/internal */ /* * Interface flags */ #define INTF_FLAG_UP 0x01 /* enable interface */ #define INTF_FLAG_LOOPBACK 0x02 /* is a loopback net (r/o) */ #define INTF_FLAG_POINTOPOINT 0x04 /* point-to-point link (r/o) */ #define INTF_FLAG_NOARP 0x08 /* disable ARP */ #define INTF_FLAG_BROADCAST 0x10 /* supports broadcast (r/o) */ #define INTF_FLAG_MULTICAST 0x20 /* supports multicast (r/o) */ typedef struct intf_handle intf_t; typedef int (*intf_handler)(const struct intf_entry *entry, void *arg); __BEGIN_DECLS intf_t *intf_open(void); int intf_get(intf_t *i, struct intf_entry *entry); int intf_get_src(intf_t *i, struct intf_entry *entry, struct addr *src); int intf_get_dst(intf_t *i, struct intf_entry *entry, struct addr *dst); int intf_set(intf_t *i, const struct intf_entry *entry); int intf_loop(intf_t *i, intf_handler callback, void *arg); intf_t *intf_close(intf_t *i); __END_DECLS #endif /* DNET_INTF_H */ libdnet-1.12/include/dnet/ip.h0000644000076500007650000004045710204741405017373 0ustar dugsongdugsong00000000000000/* * ip.h * * Internet Protocol (RFC 791). * * Copyright (c) 2000 Dug Song * * $Id: ip.h 594 2005-02-16 22:02:45Z dugsong $ */ #ifndef DNET_IP_H #define DNET_IP_H #define IP_ADDR_LEN 4 /* IP address length */ #define IP_ADDR_BITS 32 /* IP address bits */ #define IP_HDR_LEN 20 /* base IP header length */ #define IP_OPT_LEN 2 /* base IP option length */ #define IP_OPT_LEN_MAX 40 #define IP_HDR_LEN_MAX (IP_HDR_LEN + IP_OPT_LEN_MAX) #define IP_LEN_MAX 65535 #define IP_LEN_MIN IP_HDR_LEN typedef uint32_t ip_addr_t; #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * IP header, without options */ struct ip_hdr { #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t ip_v:4, /* version */ ip_hl:4; /* header length (incl any options) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t ip_hl:4, ip_v:4; #else # error "need to include " #endif uint8_t ip_tos; /* type of service */ uint16_t ip_len; /* total length (incl header) */ uint16_t ip_id; /* identification */ uint16_t ip_off; /* fragment offset and flags */ uint8_t ip_ttl; /* time to live */ uint8_t ip_p; /* protocol */ uint16_t ip_sum; /* checksum */ ip_addr_t ip_src; /* source address */ ip_addr_t ip_dst; /* destination address */ }; /* * Type of service (ip_tos), RFC 1349 ("obsoleted by RFC 2474") */ #define IP_TOS_DEFAULT 0x00 /* default */ #define IP_TOS_LOWDELAY 0x10 /* low delay */ #define IP_TOS_THROUGHPUT 0x08 /* high throughput */ #define IP_TOS_RELIABILITY 0x04 /* high reliability */ #define IP_TOS_LOWCOST 0x02 /* low monetary cost - XXX */ #define IP_TOS_ECT 0x02 /* ECN-capable transport */ #define IP_TOS_CE 0x01 /* congestion experienced */ /* * IP precedence (high 3 bits of ip_tos), hopefully unused */ #define IP_TOS_PREC_ROUTINE 0x00 #define IP_TOS_PREC_PRIORITY 0x20 #define IP_TOS_PREC_IMMEDIATE 0x40 #define IP_TOS_PREC_FLASH 0x60 #define IP_TOS_PREC_FLASHOVERRIDE 0x80 #define IP_TOS_PREC_CRITIC_ECP 0xa0 #define IP_TOS_PREC_INTERNETCONTROL 0xc0 #define IP_TOS_PREC_NETCONTROL 0xe0 /* * Fragmentation flags (ip_off) */ #define IP_RF 0x8000 /* reserved */ #define IP_DF 0x4000 /* don't fragment */ #define IP_MF 0x2000 /* more fragments (not last frag) */ #define IP_OFFMASK 0x1fff /* mask for fragment offset */ /* * Time-to-live (ip_ttl), seconds */ #define IP_TTL_DEFAULT 64 /* default ttl, RFC 1122, RFC 1340 */ #define IP_TTL_MAX 255 /* maximum ttl */ /* * Protocol (ip_p) - http://www.iana.org/assignments/protocol-numbers */ #define IP_PROTO_IP 0 /* dummy for IP */ #define IP_PROTO_HOPOPTS IP_PROTO_IP /* IPv6 hop-by-hop options */ #define IP_PROTO_ICMP 1 /* ICMP */ #define IP_PROTO_IGMP 2 /* IGMP */ #define IP_PROTO_GGP 3 /* gateway-gateway protocol */ #define IP_PROTO_IPIP 4 /* IP in IP */ #define IP_PROTO_ST 5 /* ST datagram mode */ #define IP_PROTO_TCP 6 /* TCP */ #define IP_PROTO_CBT 7 /* CBT */ #define IP_PROTO_EGP 8 /* exterior gateway protocol */ #define IP_PROTO_IGP 9 /* interior gateway protocol */ #define IP_PROTO_BBNRCC 10 /* BBN RCC monitoring */ #define IP_PROTO_NVP 11 /* Network Voice Protocol */ #define IP_PROTO_PUP 12 /* PARC universal packet */ #define IP_PROTO_ARGUS 13 /* ARGUS */ #define IP_PROTO_EMCON 14 /* EMCON */ #define IP_PROTO_XNET 15 /* Cross Net Debugger */ #define IP_PROTO_CHAOS 16 /* Chaos */ #define IP_PROTO_UDP 17 /* UDP */ #define IP_PROTO_MUX 18 /* multiplexing */ #define IP_PROTO_DCNMEAS 19 /* DCN measurement */ #define IP_PROTO_HMP 20 /* Host Monitoring Protocol */ #define IP_PROTO_PRM 21 /* Packet Radio Measurement */ #define IP_PROTO_IDP 22 /* Xerox NS IDP */ #define IP_PROTO_TRUNK1 23 /* Trunk-1 */ #define IP_PROTO_TRUNK2 24 /* Trunk-2 */ #define IP_PROTO_LEAF1 25 /* Leaf-1 */ #define IP_PROTO_LEAF2 26 /* Leaf-2 */ #define IP_PROTO_RDP 27 /* "Reliable Datagram" proto */ #define IP_PROTO_IRTP 28 /* Inet Reliable Transaction */ #define IP_PROTO_TP 29 /* ISO TP class 4 */ #define IP_PROTO_NETBLT 30 /* Bulk Data Transfer */ #define IP_PROTO_MFPNSP 31 /* MFE Network Services */ #define IP_PROTO_MERITINP 32 /* Merit Internodal Protocol */ #define IP_PROTO_SEP 33 /* Sequential Exchange proto */ #define IP_PROTO_3PC 34 /* Third Party Connect proto */ #define IP_PROTO_IDPR 35 /* Interdomain Policy Route */ #define IP_PROTO_XTP 36 /* Xpress Transfer Protocol */ #define IP_PROTO_DDP 37 /* Datagram Delivery Proto */ #define IP_PROTO_CMTP 38 /* IDPR Ctrl Message Trans */ #define IP_PROTO_TPPP 39 /* TP++ Transport Protocol */ #define IP_PROTO_IL 40 /* IL Transport Protocol */ #define IP_PROTO_IPV6 41 /* IPv6 */ #define IP_PROTO_SDRP 42 /* Source Demand Routing */ #define IP_PROTO_ROUTING 43 /* IPv6 routing header */ #define IP_PROTO_FRAGMENT 44 /* IPv6 fragmentation header */ #define IP_PROTO_RSVP 46 /* Reservation protocol */ #define IP_PROTO_GRE 47 /* General Routing Encap */ #define IP_PROTO_MHRP 48 /* Mobile Host Routing */ #define IP_PROTO_ENA 49 /* ENA */ #define IP_PROTO_ESP 50 /* Encap Security Payload */ #define IP_PROTO_AH 51 /* Authentication Header */ #define IP_PROTO_INLSP 52 /* Integated Net Layer Sec */ #define IP_PROTO_SWIPE 53 /* SWIPE */ #define IP_PROTO_NARP 54 /* NBMA Address Resolution */ #define IP_PROTO_MOBILE 55 /* Mobile IP, RFC 2004 */ #define IP_PROTO_TLSP 56 /* Transport Layer Security */ #define IP_PROTO_SKIP 57 /* SKIP */ #define IP_PROTO_ICMPV6 58 /* ICMP for IPv6 */ #define IP_PROTO_NONE 59 /* IPv6 no next header */ #define IP_PROTO_DSTOPTS 60 /* IPv6 destination options */ #define IP_PROTO_ANYHOST 61 /* any host internal proto */ #define IP_PROTO_CFTP 62 /* CFTP */ #define IP_PROTO_ANYNET 63 /* any local network */ #define IP_PROTO_EXPAK 64 /* SATNET and Backroom EXPAK */ #define IP_PROTO_KRYPTOLAN 65 /* Kryptolan */ #define IP_PROTO_RVD 66 /* MIT Remote Virtual Disk */ #define IP_PROTO_IPPC 67 /* Inet Pluribus Packet Core */ #define IP_PROTO_DISTFS 68 /* any distributed fs */ #define IP_PROTO_SATMON 69 /* SATNET Monitoring */ #define IP_PROTO_VISA 70 /* VISA Protocol */ #define IP_PROTO_IPCV 71 /* Inet Packet Core Utility */ #define IP_PROTO_CPNX 72 /* Comp Proto Net Executive */ #define IP_PROTO_CPHB 73 /* Comp Protocol Heart Beat */ #define IP_PROTO_WSN 74 /* Wang Span Network */ #define IP_PROTO_PVP 75 /* Packet Video Protocol */ #define IP_PROTO_BRSATMON 76 /* Backroom SATNET Monitor */ #define IP_PROTO_SUNND 77 /* SUN ND Protocol */ #define IP_PROTO_WBMON 78 /* WIDEBAND Monitoring */ #define IP_PROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ #define IP_PROTO_EON 80 /* ISO CNLP */ #define IP_PROTO_VMTP 81 /* Versatile Msg Transport*/ #define IP_PROTO_SVMTP 82 /* Secure VMTP */ #define IP_PROTO_VINES 83 /* VINES */ #define IP_PROTO_TTP 84 /* TTP */ #define IP_PROTO_NSFIGP 85 /* NSFNET-IGP */ #define IP_PROTO_DGP 86 /* Dissimilar Gateway Proto */ #define IP_PROTO_TCF 87 /* TCF */ #define IP_PROTO_EIGRP 88 /* EIGRP */ #define IP_PROTO_OSPF 89 /* Open Shortest Path First */ #define IP_PROTO_SPRITERPC 90 /* Sprite RPC Protocol */ #define IP_PROTO_LARP 91 /* Locus Address Resolution */ #define IP_PROTO_MTP 92 /* Multicast Transport Proto */ #define IP_PROTO_AX25 93 /* AX.25 Frames */ #define IP_PROTO_IPIPENCAP 94 /* yet-another IP encap */ #define IP_PROTO_MICP 95 /* Mobile Internet Ctrl */ #define IP_PROTO_SCCSP 96 /* Semaphore Comm Sec Proto */ #define IP_PROTO_ETHERIP 97 /* Ethernet in IPv4 */ #define IP_PROTO_ENCAP 98 /* encapsulation header */ #define IP_PROTO_ANYENC 99 /* private encryption scheme */ #define IP_PROTO_GMTP 100 /* GMTP */ #define IP_PROTO_IFMP 101 /* Ipsilon Flow Mgmt Proto */ #define IP_PROTO_PNNI 102 /* PNNI over IP */ #define IP_PROTO_PIM 103 /* Protocol Indep Multicast */ #define IP_PROTO_ARIS 104 /* ARIS */ #define IP_PROTO_SCPS 105 /* SCPS */ #define IP_PROTO_QNX 106 /* QNX */ #define IP_PROTO_AN 107 /* Active Networks */ #define IP_PROTO_IPCOMP 108 /* IP Payload Compression */ #define IP_PROTO_SNP 109 /* Sitara Networks Protocol */ #define IP_PROTO_COMPAQPEER 110 /* Compaq Peer Protocol */ #define IP_PROTO_IPXIP 111 /* IPX in IP */ #define IP_PROTO_VRRP 112 /* Virtual Router Redundancy */ #define IP_PROTO_PGM 113 /* PGM Reliable Transport */ #define IP_PROTO_ANY0HOP 114 /* 0-hop protocol */ #define IP_PROTO_L2TP 115 /* Layer 2 Tunneling Proto */ #define IP_PROTO_DDX 116 /* D-II Data Exchange (DDX) */ #define IP_PROTO_IATP 117 /* Interactive Agent Xfer */ #define IP_PROTO_STP 118 /* Schedule Transfer Proto */ #define IP_PROTO_SRP 119 /* SpectraLink Radio Proto */ #define IP_PROTO_UTI 120 /* UTI */ #define IP_PROTO_SMP 121 /* Simple Message Protocol */ #define IP_PROTO_SM 122 /* SM */ #define IP_PROTO_PTP 123 /* Performance Transparency */ #define IP_PROTO_ISIS 124 /* ISIS over IPv4 */ #define IP_PROTO_FIRE 125 /* FIRE */ #define IP_PROTO_CRTP 126 /* Combat Radio Transport */ #define IP_PROTO_CRUDP 127 /* Combat Radio UDP */ #define IP_PROTO_SSCOPMCE 128 /* SSCOPMCE */ #define IP_PROTO_IPLT 129 /* IPLT */ #define IP_PROTO_SPS 130 /* Secure Packet Shield */ #define IP_PROTO_PIPE 131 /* Private IP Encap in IP */ #define IP_PROTO_SCTP 132 /* Stream Ctrl Transmission */ #define IP_PROTO_FC 133 /* Fibre Channel */ #define IP_PROTO_RSVPIGN 134 /* RSVP-E2E-IGNORE */ #define IP_PROTO_RAW 255 /* Raw IP packets */ #define IP_PROTO_RESERVED IP_PROTO_RAW /* Reserved */ #define IP_PROTO_MAX 255 /* * Option types (opt_type) - http://www.iana.org/assignments/ip-parameters */ #define IP_OPT_CONTROL 0x00 /* control */ #define IP_OPT_DEBMEAS 0x40 /* debugging & measurement */ #define IP_OPT_COPY 0x80 /* copy into all fragments */ #define IP_OPT_RESERVED1 0x20 #define IP_OPT_RESERVED2 0x60 #define IP_OPT_EOL 0 /* end of option list */ #define IP_OPT_NOP 1 /* no operation */ #define IP_OPT_SEC (2|IP_OPT_COPY) /* DoD basic security */ #define IP_OPT_LSRR (3|IP_OPT_COPY) /* loose source route */ #define IP_OPT_TS (4|IP_OPT_DEBMEAS) /* timestamp */ #define IP_OPT_ESEC (5|IP_OPT_COPY) /* DoD extended security */ #define IP_OPT_CIPSO (6|IP_OPT_COPY) /* commercial security */ #define IP_OPT_RR 7 /* record route */ #define IP_OPT_SATID (8|IP_OPT_COPY) /* stream ID (obsolete) */ #define IP_OPT_SSRR (9|IP_OPT_COPY) /* strict source route */ #define IP_OPT_ZSU 10 /* experimental measurement */ #define IP_OPT_MTUP 11 /* MTU probe */ #define IP_OPT_MTUR 12 /* MTU reply */ #define IP_OPT_FINN (13|IP_OPT_COPY|IP_OPT_DEBMEAS) /* exp flow control */ #define IP_OPT_VISA (14|IP_OPT_COPY) /* exp access control */ #define IP_OPT_ENCODE 15 /* ??? */ #define IP_OPT_IMITD (16|IP_OPT_COPY) /* IMI traffic descriptor */ #define IP_OPT_EIP (17|IP_OPT_COPY) /* extended IP, RFC 1385 */ #define IP_OPT_TR (18|IP_OPT_DEBMEAS) /* traceroute */ #define IP_OPT_ADDEXT (19|IP_OPT_COPY) /* IPv7 ext addr, RFC 1475 */ #define IP_OPT_RTRALT (20|IP_OPT_COPY) /* router alert, RFC 2113 */ #define IP_OPT_SDB (21|IP_OPT_COPY) /* directed bcast, RFC 1770 */ #define IP_OPT_NSAPA (22|IP_OPT_COPY) /* NSAP addresses */ #define IP_OPT_DPS (23|IP_OPT_COPY) /* dynamic packet state */ #define IP_OPT_UMP (24|IP_OPT_COPY) /* upstream multicast */ #define IP_OPT_MAX 25 #define IP_OPT_COPIED(o) ((o) & 0x80) #define IP_OPT_CLASS(o) ((o) & 0x60) #define IP_OPT_NUMBER(o) ((o) & 0x1f) #define IP_OPT_TYPEONLY(o) ((o) == IP_OPT_EOL || (o) == IP_OPT_NOP) /* * Security option data - RFC 791, 3.1 */ struct ip_opt_data_sec { uint16_t s; /* security */ uint16_t c; /* compartments */ uint16_t h; /* handling restrictions */ uint8_t tcc[3]; /* transmission control code */ } __attribute__((__packed__)); #define IP_OPT_SEC_UNCLASS 0x0000 /* unclassified */ #define IP_OPT_SEC_CONFID 0xf135 /* confidential */ #define IP_OPT_SEC_EFTO 0x789a /* EFTO */ #define IP_OPT_SEC_MMMM 0xbc4d /* MMMM */ #define IP_OPT_SEC_PROG 0x5e26 /* PROG */ #define IP_OPT_SEC_RESTR 0xaf13 /* restricted */ #define IP_OPT_SEC_SECRET 0xd788 /* secret */ #define IP_OPT_SEC_TOPSECRET 0x6bc5 /* top secret */ /* * {Loose Source, Record, Strict Source} Route option data - RFC 791, 3.1 */ struct ip_opt_data_rr { uint8_t ptr; /* from start of option, >= 4 */ uint32_t iplist __flexarr; /* list of IP addresses */ } __attribute__((__packed__)); /* * Timestamp option data - RFC 791, 3.1 */ struct ip_opt_data_ts { uint8_t ptr; /* from start of option, >= 5 */ #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t oflw:4, /* number of IPs skipped */ flg:4; /* address[ / timestamp] flag */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t flg:4, oflw:4; #endif uint32_t ipts __flexarr; /* IP address [/ timestamp] pairs */ } __attribute__((__packed__)); #define IP_OPT_TS_TSONLY 0 /* timestamps only */ #define IP_OPT_TS_TSADDR 1 /* IP address / timestamp pairs */ #define IP_OPT_TS_PRESPEC 3 /* IP address / zero timestamp pairs */ /* * Traceroute option data - RFC 1393, 2.2 */ struct ip_opt_data_tr { uint16_t id; /* ID number */ uint16_t ohc; /* outbound hop count */ uint16_t rhc; /* return hop count */ uint32_t origip; /* originator IP address */ } __attribute__((__packed__)); /* * IP option (following IP header) */ struct ip_opt { uint8_t opt_type; /* option type */ uint8_t opt_len; /* option length >= IP_OPT_LEN */ union ip_opt_data { struct ip_opt_data_sec sec; /* IP_OPT_SEC */ struct ip_opt_data_rr rr; /* IP_OPT_{L,S}RR */ struct ip_opt_data_ts ts; /* IP_OPT_TS */ uint16_t satid; /* IP_OPT_SATID */ uint16_t mtu; /* IP_OPT_MTU{P,R} */ struct ip_opt_data_tr tr; /* IP_OPT_TR */ uint32_t addext[2]; /* IP_OPT_ADDEXT */ uint16_t rtralt; /* IP_OPT_RTRALT */ uint32_t sdb[9]; /* IP_OPT_SDB */ uint8_t data8[IP_OPT_LEN_MAX - IP_OPT_LEN]; } opt_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif /* * Classful addressing */ #define IP_CLASSA(i) (((uint32_t)(i) & htonl(0x80000000)) == \ htonl(0x00000000)) #define IP_CLASSA_NET (htonl(0xff000000)) #define IP_CLASSA_NSHIFT 24 #define IP_CLASSA_HOST (htonl(0x00ffffff)) #define IP_CLASSA_MAX 128 #define IP_CLASSB(i) (((uint32_t)(i) & htonl(0xc0000000)) == \ htonl(0x80000000)) #define IP_CLASSB_NET (htonl(0xffff0000)) #define IP_CLASSB_NSHIFT 16 #define IP_CLASSB_HOST (htonl(0x0000ffff)) #define IP_CLASSB_MAX 65536 #define IP_CLASSC(i) (((uint32_t)(i) & htonl(0xe0000000)) == \ htonl(0xc0000000)) #define IP_CLASSC_NET (htonl(0xffffff00)) #define IP_CLASSC_NSHIFT 8 #define IP_CLASSC_HOST (htonl(0x000000ff)) #define IP_CLASSD(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xe0000000)) /* These ones aren't really net and host fields, but routing needn't know. */ #define IP_CLASSD_NET (htonl(0xf0000000)) #define IP_CLASSD_NSHIFT 28 #define IP_CLASSD_HOST (htonl(0x0fffffff)) #define IP_MULTICAST(i) IP_CLASSD(i) #define IP_EXPERIMENTAL(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) #define IP_BADCLASS(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) #define IP_LOCAL_GROUP(i) (((uint32_t)(i) & htonl(0xffffff00)) == \ htonl(0xe0000000)) /* * Reserved addresses */ #define IP_ADDR_ANY (htonl(0x00000000)) /* 0.0.0.0 */ #define IP_ADDR_BROADCAST (htonl(0xffffffff)) /* 255.255.255.255 */ #define IP_ADDR_LOOPBACK (htonl(0x7f000001)) /* 127.0.0.1 */ #define IP_ADDR_MCAST_ALL (htonl(0xe0000001)) /* 224.0.0.1 */ #define IP_ADDR_MCAST_LOCAL (htonl(0xe00000ff)) /* 224.0.0.255 */ #define ip_pack_hdr(hdr, tos, len, id, off, ttl, p, src, dst) do { \ struct ip_hdr *ip_pack_p = (struct ip_hdr *)(hdr); \ ip_pack_p->ip_v = 4; ip_pack_p->ip_hl = 5; \ ip_pack_p->ip_tos = tos; ip_pack_p->ip_len = htons(len); \ ip_pack_p->ip_id = htons(id); ip_pack_p->ip_off = htons(off); \ ip_pack_p->ip_ttl = ttl; ip_pack_p->ip_p = p; \ ip_pack_p->ip_src = src; ip_pack_p->ip_dst = dst; \ } while (0) typedef struct ip_handle ip_t; __BEGIN_DECLS ip_t *ip_open(void); ssize_t ip_send(ip_t *i, const void *buf, size_t len); ip_t *ip_close(ip_t *i); char *ip_ntop(const ip_addr_t *ip, char *dst, size_t len); int ip_pton(const char *src, ip_addr_t *dst); char *ip_ntoa(const ip_addr_t *ip); #define ip_aton ip_pton ssize_t ip_add_option(void *buf, size_t len, int proto, const void *optbuf, size_t optlen); void ip_checksum(void *buf, size_t len); int ip_cksum_add(const void *buf, size_t len, int cksum); #define ip_cksum_carry(x) \ (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff)) __END_DECLS #endif /* DNET_IP_H */ libdnet-1.12/include/dnet/ip6.h0000644000076500007650000001262110016347553017460 0ustar dugsongdugsong00000000000000/* * ip6.h * * Internet Protocol, Version 6 (RFC 2460). * * Copyright (c) 2002 Dug Song * * $Id: ip6.h 486 2004-02-23 10:01:15Z dugsong $ */ #ifndef DNET_IP6_H #define DNET_IP6_H #define IP6_ADDR_LEN 16 #define IP6_ADDR_BITS 128 #define IP6_HDR_LEN 40 /* IPv6 header length */ #define IP6_LEN_MIN IP6_HDR_LEN #define IP6_LEN_MAX 65535 /* non-jumbo payload */ #define IP6_MTU_MIN 1280 /* minimum MTU (1024 + 256) */ typedef struct ip6_addr { uint8_t data[IP6_ADDR_LEN]; } ip6_addr_t; #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * IPv6 header */ struct ip6_hdr { union { struct ip6_hdr_ctl { uint32_t ip6_un1_flow; /* 20 bits of flow ID */ uint16_t ip6_un1_plen; /* payload length */ uint8_t ip6_un1_nxt; /* next header */ uint8_t ip6_un1_hlim; /* hop limit */ } ip6_un1; uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ } ip6_ctlun; ip6_addr_t ip6_src; ip6_addr_t ip6_dst; } __attribute__((__packed__)); #define ip6_vfc ip6_ctlun.ip6_un2_vfc #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt /* IP_PROTO_* */ #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim #define IP6_VERSION 0x60 #define IP6_VERSION_MASK 0xf0 /* ip6_vfc version */ #if DNET_BYTESEX == DNET_BIG_ENDIAN #define IP6_FLOWINFO_MASK 0x0fffffff /* ip6_flow info (28 bits) */ #define IP6_FLOWLABEL_MASK 0x000fffff /* ip6_flow label (20 bits) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN #define IP6_FLOWINFO_MASK 0xffffff0f /* ip6_flow info (28 bits) */ #define IP6_FLOWLABEL_MASK 0xffff0f00 /* ip6_flow label (20 bits) */ #endif /* * Hop limit (ip6_hlim) */ #define IP6_HLIM_DEFAULT 64 #define IP6_HLIM_MAX 255 /* * Preferred extension header order from RFC 2460, 4.1: * * IP_PROTO_IPV6, IP_PROTO_HOPOPTS, IP_PROTO_DSTOPTS, IP_PROTO_ROUTING, * IP_PROTO_FRAGMENT, IP_PROTO_AH, IP_PROTO_ESP, IP_PROTO_DSTOPTS, IP_PROTO_* */ /* * Routing header data (IP_PROTO_ROUTING) */ struct ip6_ext_data_routing { uint8_t type; /* routing type */ uint8_t segleft; /* segments left */ /* followed by routing type specific data */ } __attribute__((__packed__)); struct ip6_ext_data_routing0 { uint8_t type; /* always zero */ uint8_t segleft; /* segments left */ uint8_t reserved; /* reserved field */ uint8_t slmap[3]; /* strict/loose bit map */ ip6_addr_t addr[1]; /* up to 23 addresses */ } __attribute__((__packed__)); /* * Fragment header data (IP_PROTO_FRAGMENT) */ struct ip6_ext_data_fragment { uint16_t offlg; /* offset, reserved, and flag */ uint32_t ident; /* identification */ } __attribute__((__packed__)); /* * Fragmentation offset, reserved, and flags (offlg) */ #if DNET_BYTESEX == DNET_BIG_ENDIAN #define IP6_OFF_MASK 0xfff8 /* mask out offset from offlg */ #define IP6_RESERVED_MASK 0x0006 /* reserved bits in offlg */ #define IP6_MORE_FRAG 0x0001 /* more-fragments flag */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN #define IP6_OFF_MASK 0xf8ff /* mask out offset from offlg */ #define IP6_RESERVED_MASK 0x0600 /* reserved bits in offlg */ #define IP6_MORE_FRAG 0x0100 /* more-fragments flag */ #endif /* * Option types, for IP_PROTO_HOPOPTS, IP_PROTO_DSTOPTS headers */ #define IP6_OPT_PAD1 0x00 /* 00 0 00000 */ #define IP6_OPT_PADN 0x01 /* 00 0 00001 */ #define IP6_OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ #define IP6_OPT_JUMBO_LEN 6 #define IP6_OPT_RTALERT 0x05 /* 00 0 00101 */ #define IP6_OPT_RTALERT_LEN 4 #define IP6_OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ #define IP6_OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ #define IP6_OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ #define IP6_OPT_LEN_MIN 2 #define IP6_OPT_TYPE(o) ((o) & 0xC0) /* high 2 bits of opt_type */ #define IP6_OPT_TYPE_SKIP 0x00 /* continue processing on failure */ #define IP6_OPT_TYPE_DISCARD 0x40 /* discard packet on failure */ #define IP6_OPT_TYPE_FORCEICMP 0x80 /* discard and send ICMP on failure */ #define IP6_OPT_TYPE_ICMP 0xC0 /* ...only if non-multicast dst */ #define IP6_OPT_MUTABLE 0x20 /* option data may change en route */ /* * Extension header (chained via {ip6,ext}_nxt, following IPv6 header) */ struct ip6_ext_hdr { uint8_t ext_nxt; /* next header */ uint8_t ext_len; /* following length in units of 8 octets */ union { struct ip6_ext_data_routing routing; struct ip6_ext_data_fragment fragment; } ext_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif /* * Reserved addresses */ #define IP6_ADDR_UNSPEC \ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" #define IP6_ADDR_LOOPBACK \ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" #define ip6_pack_hdr(hdr, fc, fl, plen, nxt, hlim, src, dst) do { \ struct ip6_hdr *ip6 = (struct ip6_hdr *)(hdr); \ ip6->ip6_flow = htonl(((uint32_t)(fc) << 28) & \ (IP6_FLOWLABEL_MASK | (fl))); \ ip6->ip6_vfc = (IP6_VERSION | ((fc) >> 4)); \ ip6->ip6_plen = htons((plen)); \ ip6->ip6_nxt = (nxt); ip6->ip6_hlim = (hlim); \ memmove(&ip6->ip6_src, &(src), IP6_ADDR_LEN); \ memmove(&ip6->ip6_dst, &(dst), IP6_ADDR_LEN); \ } while (0); __BEGIN_DECLS char *ip6_ntop(const ip6_addr_t *ip6, char *dst, size_t size); int ip6_pton(const char *src, ip6_addr_t *dst); char *ip6_ntoa(const ip6_addr_t *ip6); #define ip6_aton ip6_pton void ip6_checksum(void *buf, size_t len); __END_DECLS #endif /* DNET_IP6_H */ libdnet-1.12/include/dnet/Makefile.am0000644000076500007650000000037610120211407020631 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 525 2004-09-10 02:35:51Z dugsong $ include $(top_srcdir)/Makefile.am.common dnetincludedir = $(includedir)/dnet dnetinclude_HEADERS = addr.h arp.h blob.h eth.h fw.h icmp.h intf.h ip.h \ ip6.h os.h rand.h route.h tcp.h tun.h udp.h libdnet-1.12/include/dnet/Makefile.in0000644000076500007650000001774110363627052020666 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include dnetincludedir = $(includedir)/dnet dnetinclude_HEADERS = addr.h arp.h blob.h eth.h fw.h icmp.h intf.h ip.h \ ip6.h os.h rand.h route.h tcp.h tun.h udp.h subdir = include/dnet mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = HEADERS = $(dnetinclude_HEADERS) DIST_COMMON = $(dnetinclude_HEADERS) Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/dnet/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: dnetincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-dnetincludeHEADERS: $(dnetinclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(dnetincludedir) @list='$(dnetinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(dnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(dnetincludedir)/$$f"; \ $(dnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(dnetincludedir)/$$f; \ done uninstall-dnetincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(dnetinclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(dnetincludedir)/$$f"; \ rm -f $(DESTDIR)$(dnetincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(dnetincludedir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-dnetincludeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-dnetincludeHEADERS uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am \ install-dnetincludeHEADERS install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool tags uninstall uninstall-am \ uninstall-dnetincludeHEADERS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libdnet-1.12/include/dnet/os.h0000644000076500007650000000611610204304424017372 0ustar dugsongdugsong00000000000000/* * os.h * * Sleazy OS-specific defines. * * Copyright (c) 2000 Dug Song * * $Id: os.h 583 2005-02-15 05:31:00Z dugsong $ */ #ifndef DNET_OS_H #define DNET_OS_H #ifdef _WIN32 # include # include /* XXX */ # undef IP_OPT_LSRR # undef IP_OPT_TS # undef IP_OPT_RR # undef IP_OPT_SSRR typedef u_char uint8_t; typedef u_short uint16_t; typedef u_int uint32_t; # ifndef __CYGWIN__ typedef long ssize_t; # endif #else # include # include # include # include # include # include # ifdef __bsdi__ # include typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; typedef u_int64_t uint64_t; # else # include # endif #endif #define DNET_LIL_ENDIAN 1234 #define DNET_BIG_ENDIAN 4321 /* BSD and IRIX */ #ifdef BYTE_ORDER #if BYTE_ORDER == LITTLE_ENDIAN # define DNET_BYTESEX DNET_LIL_ENDIAN #elif BYTE_ORDER == BIG_ENDIAN # define DNET_BYTESEX DNET_BIG_ENDIAN #endif #endif /* Linux */ #ifdef __BYTE_ORDER #if __BYTE_ORDER == __LITTLE_ENDIAN # define DNET_BYTESEX DNET_LIL_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN # define DNET_BYTESEX DNET_BIG_ENDIAN #endif #endif /* Solaris */ #if defined(_BIT_FIELDS_LTOH) # define DNET_BYTESEX DNET_LIL_ENDIAN #elif defined (_BIT_FIELDS_HTOL) # define DNET_BYTESEX DNET_BIG_ENDIAN #endif /* Win32 - XXX */ #ifdef _WIN32 # define DNET_BYTESEX DNET_LIL_ENDIAN #endif /* Nastiness from old BIND code. */ #ifndef DNET_BYTESEX # if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ defined(__alpha__) || defined(__alpha) # define DNET_BYTESEX DNET_LIL_ENDIAN # elif defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ defined(__hp9000s300) || defined(__hp9000s700) || defined(__ia64) || \ defined (BIT_ZERO_ON_LEFT) || defined(m68k) # define DNET_BYTESEX DNET_BIG_ENDIAN # else # error "bytesex unknown" # endif #endif /* C++ support. */ #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } /* extern "C" */ #else # define __BEGIN_DECLS # define __END_DECLS #endif /* Support for flexible arrays. */ #undef __flexarr #if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)) /* GCC 2.97 supports C99 flexible array members. */ # define __flexarr [] #else # ifdef __GNUC__ # define __flexarr [0] # else # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define __flexarr [] # elif defined(_WIN32) /* MS VC++ */ # define __flexarr [] # else /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # endif # endif #endif #endif /* DNET_OS_H */ libdnet-1.12/include/dnet/rand.h0000644000076500007650000000137607454113605017714 0ustar dugsongdugsong00000000000000/* * rand.h * * Pseudo-random number generation, based on OpenBSD arc4random(). * * Copyright (c) 2000 Dug Song * Copyright (c) 1996 David Mazieres * * $Id: rand.h 340 2002-04-07 19:01:25Z dugsong $ */ #ifndef DNET_RAND_H #define DNET_RAND_H typedef struct rand_handle rand_t; __BEGIN_DECLS rand_t *rand_open(void); int rand_get(rand_t *r, void *buf, size_t len); int rand_set(rand_t *r, const void *seed, size_t len); int rand_add(rand_t *r, const void *buf, size_t len); uint8_t rand_uint8(rand_t *r); uint16_t rand_uint16(rand_t *r); uint32_t rand_uint32(rand_t *r); int rand_shuffle(rand_t *r, void *base, size_t nmemb, size_t size); rand_t *rand_close(rand_t *r); __END_DECLS #endif /* DNET_RAND_H */ libdnet-1.12/include/dnet/route.h0000644000076500007650000000147507427404041020123 0ustar dugsongdugsong00000000000000/* * route.c * * Kernel route table operations. * * Copyright (c) 2000 Dug Song * * $Id: route.h 260 2002-02-04 04:03:45Z dugsong $ */ #ifndef DNET_ROUTE_H #define DNET_ROUTE_H /* * Routing table entry */ struct route_entry { struct addr route_dst; /* destination address */ struct addr route_gw; /* gateway address */ }; typedef struct route_handle route_t; typedef int (*route_handler)(const struct route_entry *entry, void *arg); __BEGIN_DECLS route_t *route_open(void); int route_add(route_t *r, const struct route_entry *entry); int route_delete(route_t *r, const struct route_entry *entry); int route_get(route_t *r, struct route_entry *entry); int route_loop(route_t *r, route_handler callback, void *arg); route_t *route_close(route_t *r); __END_DECLS #endif /* DNET_ROUTE_H */ libdnet-1.12/include/dnet/tcp.h0000644000076500007650000001216410016347643017552 0ustar dugsongdugsong00000000000000/* * tcp.h * * Transmission Control Protocol (RFC 793). * * Copyright (c) 2000 Dug Song * * $Id: tcp.h 487 2004-02-23 10:02:11Z dugsong $ */ #ifndef DNET_TCP_H #define DNET_TCP_H #define TCP_HDR_LEN 20 /* base TCP header length */ #define TCP_OPT_LEN 2 /* base TCP option length */ #define TCP_OPT_LEN_MAX 40 #define TCP_HDR_LEN_MAX (TCP_HDR_LEN + TCP_OPT_LEN_MAX) #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * TCP header, without options */ struct tcp_hdr { uint16_t th_sport; /* source port */ uint16_t th_dport; /* destination port */ uint32_t th_seq; /* sequence number */ uint32_t th_ack; /* acknowledgment number */ #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t th_off:4, /* data offset */ th_x2:4; /* (unused) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t th_x2:4, th_off:4; #else # error "need to include " #endif uint8_t th_flags; /* control flags */ uint16_t th_win; /* window */ uint16_t th_sum; /* checksum */ uint16_t th_urp; /* urgent pointer */ }; /* * TCP control flags (th_flags) */ #define TH_FIN 0x01 /* end of data */ #define TH_SYN 0x02 /* synchronize sequence numbers */ #define TH_RST 0x04 /* reset connection */ #define TH_PUSH 0x08 /* push */ #define TH_ACK 0x10 /* acknowledgment number set */ #define TH_URG 0x20 /* urgent pointer set */ #define TH_ECE 0x40 /* ECN echo, RFC 3168 */ #define TH_CWR 0x80 /* congestion window reduced */ #define TCP_PORT_MAX 65535 /* maximum port */ #define TCP_WIN_MAX 65535 /* maximum (unscaled) window */ /* * Sequence number comparison macros */ #define TCP_SEQ_LT(a,b) ((int)((a)-(b)) < 0) #define TCP_SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) #define TCP_SEQ_GT(a,b) ((int)((a)-(b)) > 0) #define TCP_SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) /* * TCP FSM states */ #define TCP_STATE_CLOSED 0 /* closed */ #define TCP_STATE_LISTEN 1 /* listening from connection */ #define TCP_STATE_SYN_SENT 2 /* active, have sent SYN */ #define TCP_STATE_SYN_RECEIVED 3 /* have sent and received SYN */ #define TCP_STATE_ESTABLISHED 4 /* established */ #define TCP_STATE_CLOSE_WAIT 5 /* rcvd FIN, waiting for close */ #define TCP_STATE_FIN_WAIT_1 6 /* have closed, sent FIN */ #define TCP_STATE_CLOSING 7 /* closed xchd FIN, await FIN-ACK */ #define TCP_STATE_LAST_ACK 8 /* had FIN and close, await FIN-ACK */ #define TCP_STATE_FIN_WAIT_2 9 /* have closed, FIN is acked */ #define TCP_STATE_TIME_WAIT 10 /* in 2*MSL quiet wait after close */ #define TCP_STATE_MAX 11 /* * Options (opt_type) - http://www.iana.org/assignments/tcp-parameters */ #define TCP_OPT_EOL 0 /* end of option list */ #define TCP_OPT_NOP 1 /* no operation */ #define TCP_OPT_MSS 2 /* maximum segment size */ #define TCP_OPT_WSCALE 3 /* window scale factor, RFC 1072 */ #define TCP_OPT_SACKOK 4 /* SACK permitted, RFC 2018 */ #define TCP_OPT_SACK 5 /* SACK, RFC 2018 */ #define TCP_OPT_ECHO 6 /* echo (obsolete), RFC 1072 */ #define TCP_OPT_ECHOREPLY 7 /* echo reply (obsolete), RFC 1072 */ #define TCP_OPT_TIMESTAMP 8 /* timestamp, RFC 1323 */ #define TCP_OPT_POCONN 9 /* partial order conn, RFC 1693 */ #define TCP_OPT_POSVC 10 /* partial order service, RFC 1693 */ #define TCP_OPT_CC 11 /* connection count, RFC 1644 */ #define TCP_OPT_CCNEW 12 /* CC.NEW, RFC 1644 */ #define TCP_OPT_CCECHO 13 /* CC.ECHO, RFC 1644 */ #define TCP_OPT_ALTSUM 14 /* alt checksum request, RFC 1146 */ #define TCP_OPT_ALTSUMDATA 15 /* alt checksum data, RFC 1146 */ #define TCP_OPT_SKEETER 16 /* Skeeter */ #define TCP_OPT_BUBBA 17 /* Bubba */ #define TCP_OPT_TRAILSUM 18 /* trailer checksum */ #define TCP_OPT_MD5 19 /* MD5 signature, RFC 2385 */ #define TCP_OPT_SCPS 20 /* SCPS capabilities */ #define TCP_OPT_SNACK 21 /* selective negative acks */ #define TCP_OPT_REC 22 /* record boundaries */ #define TCP_OPT_CORRUPT 23 /* corruption experienced */ #define TCP_OPT_SNAP 24 /* SNAP */ #define TCP_OPT_TCPCOMP 26 /* TCP compression filter */ #define TCP_OPT_MAX 27 #define TCP_OPT_TYPEONLY(type) \ ((type) == TCP_OPT_EOL || (type) == TCP_OPT_NOP) /* * TCP option (following TCP header) */ struct tcp_opt { uint8_t opt_type; /* option type */ uint8_t opt_len; /* option length >= TCP_OPT_LEN */ union tcp_opt_data { uint16_t mss; /* TCP_OPT_MSS */ uint8_t wscale; /* TCP_OPT_WSCALE */ uint16_t sack[19]; /* TCP_OPT_SACK */ uint32_t echo; /* TCP_OPT_ECHO{REPLY} */ uint32_t timestamp[2]; /* TCP_OPT_TIMESTAMP */ uint32_t cc; /* TCP_OPT_CC{NEW,ECHO} */ uint8_t cksum; /* TCP_OPT_ALTSUM */ uint8_t md5[16]; /* TCP_OPT_MD5 */ uint8_t data8[TCP_OPT_LEN_MAX - TCP_OPT_LEN]; } opt_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif #define tcp_pack_hdr(hdr, sport, dport, seq, ack, flags, win, urp) do { \ struct tcp_hdr *tcp_pack_p = (struct tcp_hdr *)(hdr); \ tcp_pack_p->th_sport = htons(sport); \ tcp_pack_p->th_dport = htons(dport); \ tcp_pack_p->th_seq = htonl(seq); \ tcp_pack_p->th_ack = htonl(ack); \ tcp_pack_p->th_x2 = 0; tcp_pack_p->th_off = 5; \ tcp_pack_p->th_flags = flags; \ tcp_pack_p->th_win = htons(win); \ tcp_pack_p->th_urp = htons(urp); \ } while (0) #endif /* DNET_TCP_H */ libdnet-1.12/include/dnet/tun.h0000644000076500007650000000105410175535200017560 0ustar dugsongdugsong00000000000000/* * tun.h * * Network tunnel device. * * Copyright (c) 2001 Dug Song * * $Id: tun.h 547 2005-01-25 21:30:40Z dugsong $ */ #ifndef DNET_TUN_H #define DNET_TUN_H typedef struct tun tun_t; __BEGIN_DECLS tun_t *tun_open(struct addr *src, struct addr *dst, int mtu); int tun_fileno(tun_t *tun); const char *tun_name(tun_t *tun); ssize_t tun_send(tun_t *tun, const void *buf, size_t size); ssize_t tun_recv(tun_t *tun, void *buf, size_t size); tun_t *tun_close(tun_t *tun); __END_DECLS #endif /* DNET_TUN_H */ libdnet-1.12/include/dnet/udp.h0000644000076500007650000000132107452236043017546 0ustar dugsongdugsong00000000000000/* * udp.h * * User Datagram Protocol (RFC 768). * * Copyright (c) 2000 Dug Song * * $Id: udp.h 330 2002-04-02 05:05:39Z dugsong $ */ #ifndef DNET_UDP_H #define DNET_UDP_H #define UDP_HDR_LEN 8 struct udp_hdr { uint16_t uh_sport; /* source port */ uint16_t uh_dport; /* destination port */ uint16_t uh_ulen; /* udp length (including header) */ uint16_t uh_sum; /* udp checksum */ }; #define UDP_PORT_MAX 65535 #define udp_pack_hdr(hdr, sport, dport, ulen) do { \ struct udp_hdr *udp_pack_p = (struct udp_hdr *)(hdr); \ udp_pack_p->uh_sport = htons(sport); \ udp_pack_p->uh_dport = htons(dport); \ udp_pack_p->uh_ulen = htons(ulen); \ } while (0) #endif /* DNET_UDP_H */ libdnet-1.12/include/dnet.h0000644000076500007650000000100310120215411016731 0ustar dugsongdugsong00000000000000/* * dnet.h * * Copyright (c) 2001 Dug Song * * $Id: dnet.h 529 2004-09-10 03:10:01Z dugsong $ */ #ifndef DNET_H #define DNET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* DNET_H */ libdnet-1.12/include/err.h0000644000076500007650000000421607361523034016620 0ustar dugsongdugsong00000000000000/* * err.h * * Adapted from OpenBSD libc *err* *warn* code. * * Copyright (c) 2000 Dug Song * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)err.h 8.1 (Berkeley) 6/2/93 */ #ifndef _ERR_H_ #define _ERR_H_ void err(int eval, const char *fmt, ...); void warn(const char *fmt, ...); void errx(int eval, const char *fmt, ...); void warnx(const char *fmt, ...); #endif /* !_ERR_H_ */ libdnet-1.12/include/Makefile.am0000644000076500007650000000024707434771544017727 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 294 2002-02-20 19:05:08Z dugsong $ include $(top_srcdir)/Makefile.am.common include_HEADERS = dnet.h SUBDIRS = dnet EXTRA_DIST = err.h queue.h libdnet-1.12/include/Makefile.in0000644000076500007650000002712610363627052017732 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include include_HEADERS = dnet.h SUBDIRS = dnet EXTRA_DIST = err.h queue.h subdir = include mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = HEADERS = $(include_HEADERS) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in config.h.in DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: includeHEADERS_INSTALL = $(INSTALL_HEADER) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(includedir)/$$f"; \ rm -f $(DESTDIR)$(includedir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(includedir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-includeHEADERS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am \ dvi-recursive info info-am info-recursive install install-am \ install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-includeHEADERS install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am \ uninstall-includeHEADERS uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/include/queue.h0000644000076500007650000004162407427405124017162 0ustar dugsongdugsong00000000000000/* $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. * * * A singly-linked list is headed by a single forward pointer. The elements * are singly linked for minimum space and pointer manipulation overhead at * the expense of O(n) removal for arbitrary elements. New elements can be * added to the list after an existing element or at the head of the list. * Elements being removed from the head of the list should use the explicit * macro for this purpose for optimum efficiency. A singly-linked list may * only be traversed in the forward direction. Singly-linked lists are ideal * for applications with large datasets and few or no removals or for * implementing a LIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A simple queue is headed by a pair of pointers, one the head of the * list and the other to the tail of the list. The elements are singly * linked to save space, so elements can only be removed from the * head of the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the * list. A simple queue may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the list. * A circle queue may be traversed in either direction, but has a more * complex end of list detection. * * For details on the use of these macros, see the queue(3) manual page. */ /* * Singly-linked List definitions. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } /* * Singly-linked List access methods. */ #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_END(head) NULL #define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_FOREACH(var, head, field) \ for((var) = SLIST_FIRST(head); \ (var) != SLIST_END(head); \ (var) = SLIST_NEXT(var, field)) /* * Singly-linked List functions. */ #define SLIST_INIT(head) { \ SLIST_FIRST(head) = SLIST_END(head); \ } #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ (elm)->field.sle_next = (slistelm)->field.sle_next; \ (slistelm)->field.sle_next = (elm); \ } while (0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ (elm)->field.sle_next = (head)->slh_first; \ (head)->slh_first = (elm); \ } while (0) #define SLIST_REMOVE_HEAD(head, field) do { \ (head)->slh_first = (head)->slh_first->field.sle_next; \ } while (0) #define SLIST_REMOVE(head, elm, type, field) do { \ if ((head)->slh_first == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = (head)->slh_first; \ while( curelm->field.sle_next != (elm) ) \ curelm = curelm->field.sle_next; \ curelm->field.sle_next = \ curelm->field.sle_next->field.sle_next; \ } \ } while (0) /* * List definitions. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } /* * List access methods */ #define LIST_FIRST(head) ((head)->lh_first) #define LIST_END(head) NULL #define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_FOREACH(var, head, field) \ for((var) = LIST_FIRST(head); \ (var)!= LIST_END(head); \ (var) = LIST_NEXT(var, field)) /* * List functions. */ #define LIST_INIT(head) do { \ LIST_FIRST(head) = LIST_END(head); \ } while (0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ (listelm)->field.le_next->field.le_prev = \ &(elm)->field.le_next; \ (listelm)->field.le_next = (elm); \ (elm)->field.le_prev = &(listelm)->field.le_next; \ } while (0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ (elm)->field.le_next = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &(elm)->field.le_next; \ } while (0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.le_next = (head)->lh_first) != NULL) \ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ (head)->lh_first = (elm); \ (elm)->field.le_prev = &(head)->lh_first; \ } while (0) #define LIST_REMOVE(elm, field) do { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = (elm)->field.le_next; \ } while (0) #define LIST_REPLACE(elm, elm2, field) do { \ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \ (elm2)->field.le_next->field.le_prev = \ &(elm2)->field.le_next; \ (elm2)->field.le_prev = (elm)->field.le_prev; \ *(elm2)->field.le_prev = (elm2); \ } while (0) /* * Simple queue definitions. */ #define SIMPLEQ_HEAD(name, type) \ struct name { \ struct type *sqh_first; /* first element */ \ struct type **sqh_last; /* addr of last next element */ \ } #define SIMPLEQ_HEAD_INITIALIZER(head) \ { NULL, &(head).sqh_first } #define SIMPLEQ_ENTRY(type) \ struct { \ struct type *sqe_next; /* next element */ \ } /* * Simple queue access methods. */ #define SIMPLEQ_FIRST(head) ((head)->sqh_first) #define SIMPLEQ_END(head) NULL #define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) #define SIMPLEQ_FOREACH(var, head, field) \ for((var) = SIMPLEQ_FIRST(head); \ (var) != SIMPLEQ_END(head); \ (var) = SIMPLEQ_NEXT(var, field)) /* * Simple queue functions. */ #define SIMPLEQ_INIT(head) do { \ (head)->sqh_first = NULL; \ (head)->sqh_last = &(head)->sqh_first; \ } while (0) #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ (head)->sqh_last = &(elm)->field.sqe_next; \ (head)->sqh_first = (elm); \ } while (0) #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.sqe_next = NULL; \ *(head)->sqh_last = (elm); \ (head)->sqh_last = &(elm)->field.sqe_next; \ } while (0) #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ (head)->sqh_last = &(elm)->field.sqe_next; \ (listelm)->field.sqe_next = (elm); \ } while (0) #define SIMPLEQ_REMOVE_HEAD(head, elm, field) do { \ if (((head)->sqh_first = (elm)->field.sqe_next) == NULL) \ (head)->sqh_last = &(head)->sqh_first; \ } while (0) /* * Tail queue definitions. */ #define TAILQ_HEAD(name, type) \ struct name { \ struct type *tqh_first; /* first element */ \ struct type **tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } #define TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ } /* * tail queue access methods */ #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) /* XXX */ #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) #define TAILQ_EMPTY(head) \ (TAILQ_FIRST(head) == TAILQ_END(head)) #define TAILQ_FOREACH(var, head, field) \ for((var) = TAILQ_FIRST(head); \ (var) != TAILQ_END(head); \ (var) = TAILQ_NEXT(var, field)) #define TAILQ_FOREACH_REVERSE(var, head, field, headname) \ for((var) = TAILQ_LAST(head, headname); \ (var) != TAILQ_END(head); \ (var) = TAILQ_PREV(var, headname, field)) /* * Tail queue functions. */ #define TAILQ_INIT(head) do { \ (head)->tqh_first = NULL; \ (head)->tqh_last = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ (head)->tqh_first->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_first = (elm); \ (elm)->field.tqe_prev = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.tqe_next = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ (elm)->field.tqe_next->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (listelm)->field.tqe_next = (elm); \ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ (elm)->field.tqe_next = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_REMOVE(head, elm, field) do { \ if (((elm)->field.tqe_next) != NULL) \ (elm)->field.tqe_next->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ } while (0) #define TAILQ_REPLACE(head, elm, elm2, field) do { \ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \ (elm2)->field.tqe_next->field.tqe_prev = \ &(elm2)->field.tqe_next; \ else \ (head)->tqh_last = &(elm2)->field.tqe_next; \ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ *(elm2)->field.tqe_prev = (elm2); \ } while (0) /* * Circular queue definitions. */ #define CIRCLEQ_HEAD(name, type) \ struct name { \ struct type *cqh_first; /* first element */ \ struct type *cqh_last; /* last element */ \ } #define CIRCLEQ_HEAD_INITIALIZER(head) \ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) } #define CIRCLEQ_ENTRY(type) \ struct { \ struct type *cqe_next; /* next element */ \ struct type *cqe_prev; /* previous element */ \ } /* * Circular queue access methods */ #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) #define CIRCLEQ_END(head) ((void *)(head)) #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) #define CIRCLEQ_EMPTY(head) \ (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head)) #define CIRCLEQ_FOREACH(var, head, field) \ for((var) = CIRCLEQ_FIRST(head); \ (var) != CIRCLEQ_END(head); \ (var) = CIRCLEQ_NEXT(var, field)) #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ for((var) = CIRCLEQ_LAST(head); \ (var) != CIRCLEQ_END(head); \ (var) = CIRCLEQ_PREV(var, field)) /* * Circular queue functions. */ #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = CIRCLEQ_END(head); \ (head)->cqh_last = CIRCLEQ_END(head); \ } while (0) #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ (elm)->field.cqe_prev = (listelm); \ if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm); \ else \ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ (listelm)->field.cqe_next = (elm); \ } while (0) #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm); \ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm); \ else \ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ (listelm)->field.cqe_prev = (elm); \ } while (0) #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ (elm)->field.cqe_next = (head)->cqh_first; \ (elm)->field.cqe_prev = CIRCLEQ_END(head); \ if ((head)->cqh_last == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm); \ else \ (head)->cqh_first->field.cqe_prev = (elm); \ (head)->cqh_first = (elm); \ } while (0) #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.cqe_next = CIRCLEQ_END(head); \ (elm)->field.cqe_prev = (head)->cqh_last; \ if ((head)->cqh_first == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm); \ else \ (head)->cqh_last->field.cqe_next = (elm); \ (head)->cqh_last = (elm); \ } while (0) #define CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ else \ (elm)->field.cqe_next->field.cqe_prev = \ (elm)->field.cqe_prev; \ if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm)->field.cqe_next; \ else \ (elm)->field.cqe_prev->field.cqe_next = \ (elm)->field.cqe_next; \ } while (0) #define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \ CIRCLEQ_END(head)) \ (head).cqh_last = (elm2); \ else \ (elm2)->field.cqe_next->field.cqe_prev = (elm2); \ if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \ CIRCLEQ_END(head)) \ (head).cqh_first = (elm2); \ else \ (elm2)->field.cqe_prev->field.cqe_next = (elm2); \ } while (0) #endif /* !_SYS_QUEUE_H_ */ libdnet-1.12/include/stamp-h.in0000644000076500007650000000001207640762604017556 0ustar dugsongdugsong00000000000000timestamp libdnet-1.12/INSTALL0000644000076500007650000000302410204323353015251 0ustar dugsongdugsong00000000000000 *BSD, MacOS X, Linux -------------------- ./configure && make Solaris, IRIX, BSD/OS, HP-UX, Tru64 ----------------------------------- For firewall support, install Darren Reed's IP Filter package: http://coombs.anu.edu.au/~avalon/ For tunnel support on Solaris, install the Universal TUN/TAP Driver: http://vtun.sourceforge.net/tun/ Unixware, AIX ------------- These ports are incomplete. If anyone can set me up with legitimate root access to these platforms, it would be most appreciated. :-) Windows 2000/XP --------------- For raw Ethernet sending, install the WinPcap driver and DLLs, and extract their developer pack to a build directory: http://winpcap.polito.it/install/default.htm # XXX - unsupported for now # For tunnel interface support, install the OpenVPN "TAP-Win32 Virtual # Ethernet Adapter" component (their Windows installer will let you # install it alone): # # http://openvpn.sourceforge.net/ For firewall support, install HSC's PktFilter service: http://www.hsc.fr/ressources/outils/pktfilter/index.html.en Most Windows developers should just use the libdnet developer's pack (with MinGW and MSVC++ libraries) instead of building it themselves. But for those who really want to know... To build a MinGW native library (under Cygwin+MinGW): ./configure && make To build a Microsoft Visual C++ native library and Python module (again, under Cygwin+MinGW): ./configure cd python && C:/Python23/python.exe setup.py build cd ../src && lib /out:dnet.lib *.obj # $Id: INSTALL 590 2005-02-15 07:38:19Z dugsong $ libdnet-1.12/libdnet.spec0000644000076500007650000000365310554377551016546 0ustar dugsongdugsong00000000000000# # Libdnet -- Simplified interface to low-level networking (RPM package spec) # # # Options: # --with gnuld Assume the C compiler uses GNU ld # (see --with-gnu-ld in ./configure) # %define name libdnet %define version 1.12 %define release 1 %define appname %{name}-%{version} %define rpmname %{name}-%{version}-%{release} %define buildname %{appname} Name: %{name} Version: %{version} Release: %{release} Summary: Simplified, portable interface to low-level networking routines Group: System Environment/Libraries Vendor: Dug Song URL: http://libdnet.sourceforge.net License: BSD Source: http://prdownloads.sourceforge.net/libdnet/%{appname}.tar.gz Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-root %description libdnet provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development files (Headers, libraries for static linking, etc) for %{name}. %prep rm -rf $RPM_BUILD_DIR/%{buildname} %setup -n %{buildname} %build %configure %{?_with_gnuld:--with-gnu-ld} make %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT rm $RPM_BUILD_ROOT/.%{_libdir}/*.la %clean rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_DIR/%{buildname} %post -p /sbin/ldconfig %preun -p /sbin/ldconfign %files %defattr(-,root,root) %{_sbindir} %{_libdir}/*.so.* %{_mandir}/man8 %files devel %defattr(-,root,root) %{_bindir} %{_includedir} %{_libdir}/*.a %{_libdir}/*.so %{_mandir}/man3 %doc README %doc TODO %changelog * Wed Jun 1 2004 nnposter at users,sourceforge,net - Created 1.8-1 RPM spec # vim:ts=4: libdnet-1.12/LICENSE0000644000076500007650000000266710554372471015256 0ustar dugsongdugsong00000000000000 Copyright (c) 2000-2006 Dug Song All rights reserved, all wrongs reversed. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors and copyright holders may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libdnet-1.12/Makefile.am0000644000076500007650000000071110362367313016265 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 618 2006-01-15 06:42:19Z dugsong $ include $(top_srcdir)/Makefile.am.common SUBDIRS = include man src python test bin_SCRIPTS = dnet-config EXTRA_DIST = LICENSE Makefile.am.common acconfig.h CLEANFILES = dnet-config AUX_DIST = $(ac_aux_dir)/acinclude.m4 \ $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub \ $(ac_aux_dir)/install-sh \ $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs libdnet-1.12/Makefile.am.common0000644000076500007650000000022210363626427017556 0ustar dugsongdugsong00000000000000## $Id: Makefile.am.common 623 2006-01-19 06:09:27Z dugsong $ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include libdnet-1.12/Makefile.in0000644000076500007650000003516410363627052016310 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include SUBDIRS = include man src python test bin_SCRIPTS = dnet-config EXTRA_DIST = LICENSE Makefile.am.common acconfig.h CLEANFILES = dnet-config AUX_DIST = $(ac_aux_dir)/acinclude.m4 \ $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub \ $(ac_aux_dir)/install-sh \ $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = dnet-config SCRIPTS = $(bin_SCRIPTS) depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README INSTALL Makefile.am Makefile.in THANKS TODO \ acconfig.h aclocal.m4 config/acinclude.m4 config/config.guess \ config/config.sub config/install-sh config/ltmain.sh \ config/missing config/mkinstalldirs configure configure.in \ dnet-config.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) dnet-config: $(top_builddir)/config.status dnet-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ binSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. $(distdir)/config $(distdir)/python @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ exit 1; } >&2 ) \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' 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 after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-binSCRIPTS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-binSCRIPTS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive dist dist-all \ dist-gzip distcheck distclean distclean-generic \ distclean-libtool distclean-recursive distclean-tags \ distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-binSCRIPTS \ install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-info install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/man/0000755000076500007650000000000010554406447015012 5ustar dugsongdugsong00000000000000libdnet-1.12/man/dnet.30000644000076500007650000004655110207726670016041 0ustar dugsongdugsong00000000000000.\" .\" Copyright (c) 2000 Dug Song .\" .\" $Id: dnet.3 604 2005-02-25 22:59:04Z dugsong $ .\" .Dd August 21, 2001 .Dt DNET 3 .Os .Sh NAME .Nm dnet .Nd dumb networking library .Sh SYNOPSIS .Fd #include .Ss Network addressing .Ft int .Fn addr_cmp "const struct addr *a" "const struct addr *b" .Ft int .Fn addr_bcast "const struct addr *a" "struct addr *b" .Ft int .Fn addr_net "const struct addr *a" "struct addr *b" .Ft char * .Fn addr_ntop "const struct addr *src" "char *dst" "size_t size" .Ft int .Fn addr_pton "const char *src" "struct addr *dst" .Ft char * .Fn addr_ntoa "const struct addr *a" .Ft int .Fn addr_aton "const char *src" "struct addr *dst" .Ft int .Fn addr_ntos "const struct addr *a" "struct sockaddr *sa" .Ft int .Fn addr_ston "const struct sockaddr *sa" "struct addr *a" .Ft int .Fn addr_btos "uint16_t bits" "struct sockaddr *sa" .Ft int .Fn addr_stob "const struct sockaddr *sa" "uint16_t *bits" .Ft int .Fn addr_btom "uint16_t bits" "void *mask" "size_t size" .Ft int .Fn addr_mtob "const void *mask" "size_t size" "uint16_t *bits" .Ss Address Resolution Protocol .Pp .Li typedef Ar int Fn (*arp_handler) "const struct arp_entry *entry" "void *arg" .Ft arp_t * .Fn arp_open "void" .Ft int .Fn arp_add "arp_t *a" "const struct arp_entry *entry" .Ft int .Fn arp_delete "arp_t *a" "const struct arp_entry *entry" .Ft int .Fn arp_get "arp_t *a" "struct arp_entry *entry" .Ft int .Fn arp_loop "arp_t *a" "arp_handler callback" "void *arg" .Ft arp_t * .Fn arp_close "arp_t *a" .Ss Binary buffers .Ft blob_t * .Fn blob_new "void" .Ft int .Fn blob_read "blob_t *b" "void *buf" "int len" .Ft int .Fn blob_write "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_seek "blob_t *b" "int off" "int whence" .Ft int .Fn blob_index "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_rindex "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_pack "blob_t *b" "const void *fmt" "..." .Ft int .Fn blob_unpack "blob_t *b" "const void *fmt" "..." .Ft int .Fn blob_print "blob_t *b" "char *style" "int len" .Ft blob_t * .Fn blob_free "blob_t *b" .Ss Ethernet .Ft eth_t * .Fn eth_open "const char *device" .Ft int .Fn eth_get "eth_t *e" "eth_addr_t *ea" .Ft int .Fn eth_set "eth_t *e" "const eth_addr_t *ea" .Ft ssize_t .Fn eth_send "eth_t *e" "const void *buf" "size_t len" .Ft eth_t * .Fn eth_close "eth_t *e" .Ss Firewalling .Pp .Li typedef Ar int Fn (*fw_handler) "const struct fw_rule *rule" "void *arg" .Ft fw_t * .Fn fw_open "void" .Ft int .Fn fw_add "fw_t *f" "const struct fw_rule *rule" .Ft int .Fn fw_delete "fw_t *f" "const struct fw_rule *rule" .Ft int .Fn fw_loop "fw_t *f" "fw_handler callback" "void *arg" .Ft fw_t * .Fn fw_close "fw_t *f" .Ss Network interfaces .Pp .Li typedef Ar int Fn (*intf_handler) "const struct intf_entry *entry" "void *arg" .Ft intf_t * .Fn intf_open "void" .Ft int .Fn intf_get "intf_t *i" "struct intf_entry *entry" .Ft int .Fn intf_get_src "intf_t *i" "struct intf_entry *entry" "struct addr *src" .Ft int .Fn intf_get_dst "intf_t *i" "struct intf_entry *entry" "struct addr *dst" .Ft int .Fn intf_set "intf_t *i" "const struct intf_entry *entry" .Ft int .Fn intf_loop "intf_t *i" "intf_handler callback" "void *arg" .Ft intf_t * .Fn intf_close "intf_t *i" .Ss Internet Protocol .Ft ip_t * .Fn ip_open "void" .Ft ssize_t .Fn ip_add_option "void *buf" "size_t len" "int proto" "const void *optbuf" "size_t optlen" .Ft void .Fn ip_checksum "void *buf" "size_t len" .Ft ssize_t .Fn ip_send "ip_t *i" "const void *buf" "size_t len" .Ft ip_t * .Fn ip_close "ip_t *i" .Ss Internet Protocol Version 6 .Ft void .Fn ip6_checksum "void *buf" "size_t len" .Ss Random number generation .Pp .Ft rand_t * .Fn rand_open "void" .Ft int .Fn rand_get "rand_t *r" "void *buf" "size_t len" .Ft int .Fn rand_set "rand_t *r" "const void *seed" "size_t len" .Ft int .Fn rand_add "rand_t *r" "const void *buf" "size_t len" .Ft uint8_t .Fn rand_uint8 "rand_t *r" .Ft uint16_t .Fn rand_uint16 "rand_t *r" .Ft uint32_t .Fn rand_uint32 "rand_t *r" .Ft int .Fn rand_shuffle "rand_t *r" "void *base" "size_t nmemb" "size_t size" .Ft rand_t * .Fn rand_close "rand_t *r" .Ss Routing .Pp .Li typedef Ar int Fn (*route_handler) "const struct route_entry *entry" "void *arg" .Ft route_t * .Fn route_open "void" .Ft int .Fn route_add "route_t *r" "const struct route_entry *entry" .Ft int .Fn route_delete "route_t *r" "const struct route_entry *entry" .Ft int .Fn route_get "route_t *r" "struct route_entry *entry" .Ft int .Fn route_loop "route_t *r" "route_handler callback" "void *arg" .Ft route_t * .Fn route_close "route_t *r" .Ss Tunnel interface .Pp .Ft tun_t * .Fn tun_open "struct addr *src" "struct addr *dst" "int mtu" .Ft int .Fn tun_fileno "tun_t *t" .Ft const char * .Fn tun_name "tun_t *t" .Ft ssize_t .Fn tun_send "tun_t *t" "const void *buf" "size_t size" .Ft ssize_t .Fn tun_recv "tun_t *t" "void *buf" "size_t size" .Ft tun_t * .Fn tun_close "tun_t *t" .Pp .Sh DESCRIPTION .Nm provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel .Xr arp 4 cache and .Xr route 4 table lookup and manipulation, network firewalling, network interface lookup and manipulation, and raw IP packet and Ethernet frame transmission. It is intended to complement the functionality provided by .Xr pcap 3 . .Pp In addition, .Nm also provides platform-independent definitions of various network protocol formats and values for portable low-level network programming, as well as a simple binary buffer handling API. .Pp .Ss Network addressing Network addresses are described by the following structure: .Bd -literal struct addr { uint16_t addr_type; uint16_t addr_bits; union { eth_addr_t __eth; ip_addr_t __ip; ip6_addr_t __ip6; uint8_t __data8[16]; uint16_t __data16[8]; uint32_t __data32[4]; } __addr_u; }; #define addr_eth __addr_u.__eth #define addr_ip __addr_u.__ip #define addr_ip6 __addr_u.__ip6 #define addr_data8 __addr_u.__data8 #define addr_data16 __addr_u.__data16 #define addr_data32 __addr_u.__data32 .Ed .Pp The following values are defined for .Ar addr_type : .Bd -literal #define ADDR_TYPE_NONE 0 /* No address set */ #define ADDR_TYPE_ETH 1 /* Ethernet */ #define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ #define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ .Ed .Pp The field .Ar addr_bits denotes the length of the network mask in bits. .Pp .Fn addr_cmp compares network addresses .Fa a and .Fa b , returning an integer less than, equal to, or greater than zero if .Fa a is found, respectively, to be less than, equal to, or greater than .Fa b . Both addresses must be of the same address type. .Pp .Fn addr_bcast computes the broadcast address for the network specified in .Fa a and writes it into .Fa b . .Pp .Fn addr_net computes the network address for the network specified in .Fa a and writes it into .Fa b . .Pp .Fn addr_ntop converts an address from network format to a string. .Pp .Fn addr_pton converts an address (or hostname) from a string to network format. .Pp .Fn addr_ntoa converts an address from network format to a string, returning a pointer to the result in static memory. .Pp .Fn addr_aton is a synonym for .Fn addr_pton . .Pp .Fn addr_ntos converts an address from network format to the appropriate struct sockaddr. .Pp .Fn addr_ston converts an address from a struct sockaddr to network format. .Pp .Fn addr_btos converts a network mask length to a network mask specified as a struct sockaddr. .Pp .Fn addr_stob converts a network mask specified in a struct sockaddr to a network mask length. .Pp .Fn addr_btom converts a network mask length to a network mask in network byte order. .Pp .Fn addr_mtob converts a network mask in network byte order to a network mask length. .Ss Address Resolution Protocol ARP cache entries are described by the following structure: .Bd -literal struct arp_entry { struct addr arp_pa; /* protocol address */ struct addr arp_ha; /* hardware address */ }; .Ed .Pp .Fn arp_open is used to obtain a handle to access the kernel .Xr arp 4 cache. .Pp .Fn arp_add adds a new ARP .Fa entry . .Pp .Fn arp_delete deletes the ARP .Fa entry for the protocol address specified by .Fa arp_pa . .Pp .Fn arp_get retrieves the ARP .Fa entry for the protocol address specified by .Fa arp_pa . .Pp .Fn arp_loop iterates over the kernel .Xr arp 4 cache, invoking the specified .Fa callback with each .Fa entry and the context .Fa arg passed to .Fn arp_loop . .Pp .Fn arp_close closes the specified handle. .Pp .Ss Binary buffers Binary buffers are described by the following structure: .Bd -literal typedef struct blob { u_char *base; /* start of data */ int off; /* offset into data */ int end; /* end of data */ int size; /* size of allocation */ } blob_t; .Ed .Pp .Fn blob_new is used to allocate a new dynamic binary buffer, returning NULL on failure. .Pp .Fn blob_read reads .Fa len bytes from the current offset in blob .Fa b into .Fa buf , returning the total number of bytes read, or -1 on failure. .Pp .Fn blob_write writes .Fa len bytes from .Fa buf to blob .Fa b , advancing the current offset. It returns the number of bytes written, or -1 on failure. .Pp .Fn blob_seek repositions the offset within blob .Fa b to .Fa off , according to the directive .Fa whence (see .Xr lseek 2 for details), returning the new absolute offset, or -1 on failure. .Pp .Fn blob_index returns the offset of the first occurence in blob .Fa b of the specified .Fa buf of length .Fa len , or -1 on failure. .Pp .Fn blob_rindex returns the offset of the last occurence in blob .Fa b of the specified .Fa buf of length .Fa len , or -1 on failure. .Pp .Fn blob_pack converts and writes, and .Fn blob_unpack reads and converts data in blob .Fa b according to the given format .Fa fmt as described below, returning 0 on success, and -1 on failure. .Pp The format string is composed of zero or more directives: ordinary characters (not .Cm % ), which are copied to / read from the blob, and conversion specifications, each of which results in reading / writing zero or more subsequent arguments. .Pp Each conversion specification is introduced by the character .Cm % , and may be prefixed by length specifier. The arguments must correspond properly (after type promotion) with the length and conversion specifiers. .Pp The length specifier is either a a decimal digit string specifying the length of the following argument, or the literal character .Cm * indicating that the length should be read from an integer argument for the argument following it. .Pp The conversion specifiers and their meanings are: .Bl -tag -width indent .It Cm D An unsigned 32-bit integer in network byte order. .It Cm H An unsigned 16-bit integer in network byte order. .It Cm b A binary buffer (length specifier required). .It Cm c An unsigned character. .It Cm d An unsigned 32-bit integer in host byte order. .It Cm h An unsigned 16-bit integer in host byte order. .It Cm s A C-style null-terminated string, whose maximum length must be specified when unpacking. .El .Pp Custom conversion routines and their specifiers may be registered via .Fn blob_register_pack , currently undocumented. .Pp .Fn blob_print prints .Fa len bytes of the contents of blob .Fa b from the current offset in the specified .Fa style ; currently only .Dq hexl is available. .Pp .Fn blob_free deallocates the memory associated with blob .Fa b and returns NULL. .Pp .Ss Ethernet .Fn eth_open is used to obtain a handle to transmit raw Ethernet frames via the specified network .Fa device . .Pp .Fn eth_get retrieves the hardware MAC address for the interface specified by .Ar e . .Pp .Fn eth_set configures the hardware MAC address for the interface specified by .Ar e . .Pp .Fn eth_send transmits .Fa len bytes of the Ethernet frame pointed to by .Fa buf . .Pp .Fn eth_close closes the specified handle. .Pp .Ss Firewalling Firewall rules are described by the following structure: .Bd -literal struct fw_rule { char fw_device[INTF_NAME_LEN]; /* interface name */ uint8_t fw_op; /* operation */ uint8_t fw_dir; /* direction */ uint8_t fw_proto; /* IP protocol */ struct addr fw_src; /* src address / net */ struct addr fw_dst; /* dst address / net */ uint16_t fw_sport[2]; /* range / ICMP type */ uint16_t fw_dport[2]; /* range / ICMP code */ }; .Ed .Pp The following values are defined for .Ar fw_op : .Bd -literal #define FW_OP_ALLOW 1 #define FW_OP_BLOCK 2 .Ed .Pp The following values are defined for .Ar fw_dir : .Bd -literal #define FW_DIR_IN 1 #define FW_DIR_OUT 2 .Ed .Pp .Fn fw_open is used to obtain a handle to access the local network firewall configuration. .Pp .Fn fw_add adds the specified firewall .Fa rule . .Pp .Fn fw_delete deletes the specified firewall .Fa rule . .Pp .Fn fw_loop iterates over the active firewall ruleset, invoking the specified .Fa callback with each .Fa rule and the context .Fa arg passed to .Fn fw_loop . .Pp .Fn fw_close closes the specified handle. .Pp .Ss Network interfaces Network interface information is described by the following structure: .Bd -literal #define INTF_NAME_LEN 16 struct intf_entry { u_int intf_len; /* length of entry */ char intf_name[INTF_NAME_LEN]; /* interface name */ u_short intf_type; /* interface type (r/o) */ u_short intf_flags; /* interface flags */ u_int intf_mtu; /* interface MTU */ struct addr intf_addr; /* interface address */ struct addr intf_dst_addr; /* point-to-point dst */ struct addr intf_link_addr; /* link-layer address */ u_int intf_alias_num; /* number of aliases */ struct addr intf_alias_addrs __flexarr; /* array of aliases */ }; .Ed .Pp The following bitmask values are defined for .Ar intf_type : .Bd -literal #define INTF_TYPE_OTHER 1 /* other */ #define INTF_TYPE_ETH 6 /* Ethernet */ #define INTF_TYPE_LOOPBACK 24 /* software loopback */ #define INTF_TYPE_TUN 53 /* proprietary virtual/internal */ .Ed .Pp The following bitmask values are defined for .Ar intf_flags : .Bd -literal #define INTF_FLAG_UP 0x01 /* enable interface */ #define INTF_FLAG_LOOPBACK 0x02 /* is a loopback net (r/o) */ #define INTF_FLAG_POINTOPOINT 0x04 /* point-to-point link (r/o) */ #define INTF_FLAG_NOARP 0x08 /* disable ARP */ #define INTF_FLAG_BROADCAST 0x10 /* supports broadcast (r/o) */ #define INTF_FLAG_MULTICAST 0x20 /* supports multicast (r/o) */ .Ed .Pp .Fn intf_open is used to obtain a handle to access the network interface configuration. .Pp .Fn intf_get retrieves an interface configuration .Fa entry , keyed on .Fa intf_name . For all .Fn intf_get functions, .Fa intf_len should be set to the size of the buffer pointed to by .Fa entry (usually sizeof(struct intf_entry), but should be larger to accomodate any interface alias addresses. .Pp .Fn intf_get_src retrieves the configuration for the interface whose primary address matches the specified .Fa src . .Pp .Fn intf_get_dst retrieves the configuration for the best interface with which to reach the specified .Fa dst . .Pp .Fn intf_set sets the interface configuration .Fa entry . .Pp .Fn intf_loop iterates over all network interfaces, invoking the specified .Fa callback with each interface configuration .Fa entry and the context .Fa arg passed to .Fn intf_loop . .Pp .Fn intf_close closes the specified handle. .Pp .Ss Internet Protocol .Fn ip_open is used to obtain a handle to transmit raw IP packets, routed by the kernel. .Pp .Fn ip_add_option adds the header option for the protocol .Fa proto specified by .Fa optbuf of length .Fa optlen and appends it to the appropriate header of the IP packet contained in .Fa buf of size .Fa len , shifting any existing payload and adding NOPs to pad the option to a word boundary if necessary. .Pp .Fn ip_checksum sets the IP checksum and any appropriate transport protocol checksum for the IP packet pointed to by .Fa buf of length .Fa len . .Pp .Fn ip_send transmits .Fa len bytes of the IP packet pointed to by .Fa buf . .Pp .Fn ip_close closes the specified handle. .Pp .Ss Internet Protocol Version 6 .Fn ip6_checksum sets the appropriate transport protocol checksum for the IPv6 packet pointed to by .Fa buf of length .Fa len . .Pp .Ss Random number generation .Fn rand_open is used to obtain a handle for fast, cryptographically strong pseudo-random number generation. The starting seed is derived from the system random data source device (if one exists), or from the current time and random stack contents. .Pp .Fn rand_set re-initializes the PRNG to start from a known .Fa seed value, useful in generating repeatable sequences. .Pp .Fn rand_get writes .Fa len random bytes into .Fa buf . .Pp .Fn rand_add adds .Fa len bytes of entropy data from .Fa buf into the random mix. .Pp .Fn rand_uint8 , .Fn rand_uint16 , and .Fn rand_uint32 return 8, 16, and 32-bit unsigned random values, respectively. .Pp .Fn rand_shuffle randomly shuffles an array of .Fa nmemb elements of .Fa size bytes, starting at .Fa base . .Pp .Fn rand_close closes the specified handle. .Pp .Ss Routing Routing table entries are described by the following structure: .Bd -literal struct route_entry { struct addr route_dst; /* destination address */ struct addr route_gw; /* gateway address */ }; .Ed .Pp .Fn route_open is used to obtain a handle to access the kernel .Xr route 4 table. .Pp .Fn route_add adds a new routing table .Fa entry . .Pp .Fn route_delete deletes the routing table .Fa entry for the destination prefix specified by .Fa route_dst . .Pp .Fn route_get retrieves the routing table .Fa entry for the destination prefix specified by .Fa route_dst . .Pp .Fn route_loop iterates over the kernel .Xr route 4 table, invoking the specified .Fa callback with each .Fa entry and the context .Fa arg passed to .Fn route_loop . .Pp .Fn route_close closes the specified handle. .Pp .Ss Tunnel interface .Fn tun_open is used to obtain a handle to a network tunnel interface, to which IP packets destined for .Fa dst are delivered (with source addresses rewritten to .Fa src ), where they may be read by a userland process and processed as desired. IP packets written back to the handle are injected into the kernel networking subsystem. .Pp .Fn tun_fileno returns a file descriptor associated with the tunnel handle, suitable for .Xr select 2 . .Pp .Fn tun_name returns a pointer to the tunnel interface name. .Pp .Fn tun_send submits a packet to the kernel networking subsystem for delivery. .Pp .Fn tun_recv reads the next packet delivered to the tunnel interface. .Pp .Fn tun_close closes the specified handle. .Pp .Sh RETURN VALUES .Fn addr_ntop returns a pointer to the .Fa dst argument, or NULL on failure. .Pp .Fn addr_ntoa returns a pointer to a static memory area containing the printable address, or NULL on failure. .Pp .Fn arp_open , .Fn eth_open , .Fn fw_open , .Fn intf_open , .Fn ip_open , .Fn rand_open , and .Fn route_open return a valid handle on success, or NULL on failure. .Pp .Fn arp_close , .Fn eth_close , .Fn fw_close , .Fn intf_close , .Fn ip_close , .Fn rand_close , and .Fn route_close always return NULL. .Pp .Fn eth_send and .Fn ip_send return the length of the datagram successfully sent, or -1 on failure. .Pp .Fn arp_loop , .Fn fw_loop , .Fn intf_loop , and .Fn route_loop return the status of their .Fa callback routines. Any non-zero return from a .Fa callback will cause the loop to exit immediately. .Pp .Fn ip_add_option returns the length of the inserted option (which may have been padded with NOPs for memory alignment) or -1 on failure. .Pp .Fn rand_uint8 , .Fn rand_uint16 , and .Fn rand_uint32 return 8, 16, and 32-bit unsigned random values, respectively. .Pp All other .Nm routines return 0 on success, or -1 on failure. .Sh SEE ALSO .Xr pcap 3 .Sh AUTHORS Dug Song .Aq dugsong@monkey.org libdnet-1.12/man/Makefile.am0000644000076500007650000000032307361230050017027 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 11 2001-10-11 05:37:44Z dugsong $ include $(top_srcdir)/Makefile.am.common man_MANS = dnet.3 EXTRA_DIST = $(man_MANS) dnet.3.txt: dnet.3 groff -t -e -mdoc -Tascii dnet.3 | col -bx > $@ libdnet-1.12/man/Makefile.in0000644000076500007650000001700010363627052017050 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include man_MANS = dnet.3 EXTRA_DIST = $(man_MANS) subdir = man mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: man3dir = $(mandir)/man3 install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man3dir) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \ rm -f $(DESTDIR)$(man3dir)/$$inst; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(man3dir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man3 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man3 .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-man3 install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am \ uninstall-man uninstall-man3 dnet.3.txt: dnet.3 groff -t -e -mdoc -Tascii dnet.3 | col -bx > $@ # 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: libdnet-1.12/python/0000755000076500007650000000000010554406367015561 5ustar dugsongdugsong00000000000000libdnet-1.12/python/dnet.c0000644000076500007650000135714010554377612016672 0ustar dugsongdugsong00000000000000/* Generated by Pyrex 0.9.4.1 on Sat Jan 20 06:39:10 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif __PYX_EXTERN_C double pow(double, double); #include "dnet.h" typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t); /*proto*/ static int __Pyx_EndUnpack(PyObject *, Py_ssize_t); /*proto*/ static int __Pyx_PrintItem(PyObject *); /*proto*/ static int __Pyx_PrintNewline(void); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static void __Pyx_ReRaise(void); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetExcValue(void); /*proto*/ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2); /*proto*/ static void __Pyx_WriteUnraisable(char *name); /*proto*/ static void __Pyx_AddTraceback(char *funcname); /*proto*/ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ static int __Pyx_InitCApi(PyObject *module); /*proto*/ static int __Pyx_ImportModuleCApi(__Pyx_CApiTabEntry *t); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static PyObject *__pyx_m; static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; static char **__pyx_f; static char __pyx_mdoc[] = "dumb networking library\n\nThis module provides a simplified interface to several low-level\nnetworking routines, including network address manipulation, kernel\narp(4) cache and route(4) table lookup and manipulation, network\nfirewalling, network interface lookup and manipulation, IP tunnelling,\nand raw IP packet and Ethernet frame transmission.\n"; /* Declarations from dnet */ enum { __pyx_e_4dnet_TEADELTA = 2654435769, __pyx_e_4dnet_TEAROUNDS = 32, __pyx_e_4dnet_TEASBOXSIZE = 128, __pyx_e_4dnet_TEASBOXSHIFT = 7, }; struct __pyx_obj_4dnet_eth { PyObject_HEAD eth_t (*eth); }; struct __pyx_obj_4dnet_ip { PyObject_HEAD ip_t (*ip); }; struct __pyx_obj_4dnet_addr { PyObject_HEAD struct addr _addr; }; struct __pyx_obj_4dnet___addr_ip4_iter { PyObject_HEAD unsigned long cur; unsigned long max; }; struct __pyx_obj_4dnet_arp { PyObject_HEAD arp_t (*arp); }; struct __pyx_obj_4dnet_intf { PyObject_HEAD intf_t (*intf); }; struct __pyx_obj_4dnet_route { PyObject_HEAD route_t (*route); }; struct __pyx_obj_4dnet_fw { PyObject_HEAD fw_t (*fw); }; struct __pyx_obj_4dnet_rand { PyObject_HEAD rand_t (*rand); }; struct __pyx_obj_4dnet___rand_xrange { PyObject_HEAD rand_t (*rand); unsigned long cur; unsigned long enc; unsigned long max; unsigned long mask; unsigned long start; unsigned long sboxmask; unsigned int (sbox[128]); int left; int right; int kshift; }; struct __pyx_obj_4dnet_tun { PyObject_HEAD tun_t (*tun); char (*buf); int mtu; }; static PyTypeObject *__pyx_ptype_4dnet_eth = 0; static PyTypeObject *__pyx_ptype_4dnet_ip = 0; static PyTypeObject *__pyx_ptype_4dnet_addr = 0; static PyTypeObject *__pyx_ptype_4dnet___addr_ip4_iter = 0; static PyTypeObject *__pyx_ptype_4dnet_arp = 0; static PyTypeObject *__pyx_ptype_4dnet_intf = 0; static PyTypeObject *__pyx_ptype_4dnet_route = 0; static PyTypeObject *__pyx_ptype_4dnet_fw = 0; static PyTypeObject *__pyx_ptype_4dnet_rand = 0; static PyTypeObject *__pyx_ptype_4dnet___rand_xrange = 0; static PyTypeObject *__pyx_ptype_4dnet_tun = 0; static PyObject *__pyx_k16; static PyObject *__pyx_k17; static PyObject *__pyx_k18; static PyObject *__pyx_k24; static PyObject *__pyx_k25; static PyObject *__pyx_k26; static PyObject *__pyx_k27; static PyObject *__pyx_k28; static PyObject *__pyx_k29; static PyObject *__pyx_k30; static PyObject *__pyx_k31; static PyObject *__pyx_k34; static PyObject *__pyx_k35; static PyObject *__pyx_k36; static PyObject *__pyx_k37; static PyObject *__pyx_k38; static PyObject *__pyx_k39; static PyObject *__pyx_k40; static PyObject *__pyx_k41; static PyObject *__pyx_k42; static PyObject *__pyx_k43; static PyObject *__pyx_k44; static PyObject *__pyx_k45; static PyObject *__pyx_k46; static PyObject *__pyx_k47; static PyObject *__pyx_k48; static PyObject *__pyx_k49; static PyObject *__pyx_k50; static PyObject *__pyx_k51; static PyObject *__pyx_k52; static PyObject *__pyx_k53; static PyObject *__pyx_k54; static PyObject *__pyx_k55; static PyObject *__pyx_k56; static PyObject *__pyx_k57; static PyObject *__pyx_k58; static PyObject *__pyx_k59; static PyObject *(__pyx_f_4dnet___memcpy(char (*),PyObject *,int )); /*proto*/ static PyObject *(__pyx_f_4dnet___oserror(void)); /*proto*/ static int (__pyx_f_4dnet___arp_callback(struct arp_entry (*),void (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_ifent_to_dict(struct intf_entry (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_dict_to_ifent(PyObject *,struct intf_entry (*))); /*proto*/ static int (__pyx_f_4dnet___intf_callback(struct intf_entry (*),void (*))); /*proto*/ static int (__pyx_f_4dnet___route_callback(struct route_entry (*),void (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_rule_to_dict(struct fw_rule (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_dict_to_rule(PyObject *,struct fw_rule (*))); /*proto*/ static int (__pyx_f_4dnet___fw_callback(struct fw_rule (*),void (*))); /*proto*/ /* Implementation of dnet */ static char (__pyx_k1[]) = "Address type (ADDR_TYPE_*) integer."; static char (__pyx_k2[]) = "Address bitlength integer."; static char (__pyx_k3[]) = "Raw address string."; static char (__pyx_k4[]) = "Ethernet MAC address as binary string."; static char (__pyx_k5[]) = "IPv4 address as binary string."; static char (__pyx_k6[]) = "IPv6 address as binary string."; static char (__pyx_k7[]) = "Tunnel interface name."; static char (__pyx_k8[]) = "File descriptor for tunnel handle."; static char (__pyx_k9[]) = "Dug Song "; static char (__pyx_k10[]) = "Copyright (c) 2003 Dug Song"; static char (__pyx_k12[]) = "http://libdnet.sourceforge.net/"; static char (__pyx_k13[]) = "1.12"; static char (__pyx_k14[]) = "\x000\x000\x000\x000\x000\x000"; static char (__pyx_k15[]) = "\x0ff\x0ff\x0ff\x0ff\x0ff\x0ff"; static char (__pyx_k19[]) = "\x000\x000\x000\x000"; static char (__pyx_k20[]) = "\x0ff\x0ff\x0ff\x0ff"; static char (__pyx_k21[]) = "\x07f\x000\x000\x001"; static char (__pyx_k22[]) = "\x0e0\x000\x000\x001"; static char (__pyx_k23[]) = "\x0e0\x000\x000\x0ff"; static char (__pyx_k32[]) = "\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000"; static char (__pyx_k33[]) = "\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001"; static PyObject *__pyx_n___author__; static PyObject *__pyx_n___copyright__; static PyObject *__pyx_n___license__; static PyObject *__pyx_n___url__; static PyObject *__pyx_n___version__; static PyObject *__pyx_n___iter_append; static PyObject *__pyx_n_ETH_ADDR_LEN; static PyObject *__pyx_n_ETH_ADDR_BITS; static PyObject *__pyx_n_ETH_TYPE_LEN; static PyObject *__pyx_n_ETH_CRC_LEN; static PyObject *__pyx_n_ETH_HDR_LEN; static PyObject *__pyx_n_ETH_LEN_MIN; static PyObject *__pyx_n_ETH_LEN_MAX; static PyObject *__pyx_n_ETH_MTU; static PyObject *__pyx_n_ETH_MIN; static PyObject *__pyx_n_ETH_TYPE_PUP; static PyObject *__pyx_n_ETH_TYPE_IP; static PyObject *__pyx_n_ETH_TYPE_ARP; static PyObject *__pyx_n_ETH_TYPE_REVARP; static PyObject *__pyx_n_ETH_TYPE_8021Q; static PyObject *__pyx_n_ETH_TYPE_IPV6; static PyObject *__pyx_n_ETH_TYPE_MPLS; static PyObject *__pyx_n_ETH_TYPE_MPLS_MCAST; static PyObject *__pyx_n_ETH_TYPE_PPPOEDISC; static PyObject *__pyx_n_ETH_TYPE_PPPOE; static PyObject *__pyx_n_ETH_TYPE_LOOPBACK; static PyObject *__pyx_n_ETH_ADDR_UNSPEC; static PyObject *__pyx_n_ETH_ADDR_BROADCAST; static PyObject *__pyx_n_eth_ntoa; static PyObject *__pyx_n_eth_aton; static PyObject *__pyx_n_eth_pack_hdr; static PyObject *__pyx_n_IP_ADDR_LEN; static PyObject *__pyx_n_IP_ADDR_BITS; static PyObject *__pyx_n_IP_HDR_LEN; static PyObject *__pyx_n_IP_OPT_LEN; static PyObject *__pyx_n_IP_OPT_LEN_MAX; static PyObject *__pyx_n_IP_HDR_LEN_MAX; static PyObject *__pyx_n_IP_LEN_MAX; static PyObject *__pyx_n_IP_LEN_MIN; static PyObject *__pyx_n_IP_TOS_DEFAULT; static PyObject *__pyx_n_IP_RF; static PyObject *__pyx_n_IP_DF; static PyObject *__pyx_n_IP_MF; static PyObject *__pyx_n_IP_OFFMASK; static PyObject *__pyx_n_IP_TTL_DEFAULT; static PyObject *__pyx_n_IP_TTL_MAX; static PyObject *__pyx_n_IP_PROTO_IP; static PyObject *__pyx_n_IP_PROTO_ICMP; static PyObject *__pyx_n_IP_PROTO_IGMP; static PyObject *__pyx_n_IP_PROTO_TCP; static PyObject *__pyx_n_IP_PROTO_UDP; static PyObject *__pyx_n_IP_PROTO_IPV6; static PyObject *__pyx_n_IP_PROTO_GRE; static PyObject *__pyx_n_IP_PROTO_ESP; static PyObject *__pyx_n_IP_PROTO_AH; static PyObject *__pyx_n_IP_PROTO_ICMPV6; static PyObject *__pyx_n_IP_PROTO_RAW; static PyObject *__pyx_n_IP_PROTO_RESERVED; static PyObject *__pyx_n_IP_PROTO_MAX; static PyObject *__pyx_n_IP_ADDR_ANY; static PyObject *__pyx_n_IP_ADDR_BROADCAST; static PyObject *__pyx_n_IP_ADDR_LOOPBACK; static PyObject *__pyx_n_IP_ADDR_MCAST_ALL; static PyObject *__pyx_n_IP_ADDR_MCAST_LOCAL; static PyObject *__pyx_n_ip_ntoa; static PyObject *__pyx_n_ip_aton; static PyObject *__pyx_n_ip_checksum; static PyObject *__pyx_n_ip_cksum_add; static PyObject *__pyx_n_ip_cksum_carry; static PyObject *__pyx_n_ip_pack_hdr; static PyObject *__pyx_n_IP6_ADDR_LEN; static PyObject *__pyx_n_IP6_ADDR_BITS; static PyObject *__pyx_n_IP6_HDR_LEN; static PyObject *__pyx_n_IP6_LEN_MIN; static PyObject *__pyx_n_IP6_LEN_MAX; static PyObject *__pyx_n_IP6_MTU_MIN; static PyObject *__pyx_n_IP6_HLIM_DEFAULT; static PyObject *__pyx_n_IP6_HLIM_MAX; static PyObject *__pyx_n_IP6_ADDR_UNSPEC; static PyObject *__pyx_n_IP6_ADDR_LOOPBACK; static PyObject *__pyx_n_ip6_ntoa; static PyObject *__pyx_n_ip6_aton; static PyObject *__pyx_n_ip6_checksum; static PyObject *__pyx_n_ip6_pack_hdr; static PyObject *__pyx_n_ADDR_TYPE_NONE; static PyObject *__pyx_n_ADDR_TYPE_ETH; static PyObject *__pyx_n_ADDR_TYPE_IP; static PyObject *__pyx_n_ADDR_TYPE_IP6; static PyObject *__pyx_n_ARP_HDR_LEN; static PyObject *__pyx_n_ARP_ETHIP_LEN; static PyObject *__pyx_n_ARP_HRD_ETH; static PyObject *__pyx_n_ARP_HRD_IEEE802; static PyObject *__pyx_n_ARP_PRO_IP; static PyObject *__pyx_n_ARP_OP_REQUEST; static PyObject *__pyx_n_ARP_OP_REPLY; static PyObject *__pyx_n_ARP_OP_REVREQUEST; static PyObject *__pyx_n_ARP_OP_REVREPLY; static PyObject *__pyx_n_arp_pack_hdr_ethip; static PyObject *__pyx_n_icmp_pack_hdr; static PyObject *__pyx_n_TCP_HDR_LEN; static PyObject *__pyx_n_TH_FIN; static PyObject *__pyx_n_TH_SYN; static PyObject *__pyx_n_TH_RST; static PyObject *__pyx_n_TH_PUSH; static PyObject *__pyx_n_TH_ACK; static PyObject *__pyx_n_TH_URG; static PyObject *__pyx_n_TH_ECE; static PyObject *__pyx_n_TH_CWR; static PyObject *__pyx_n_TCP_PORT_MAX; static PyObject *__pyx_n_TCP_WIN_MAX; static PyObject *__pyx_n_TCP_OPT_EOL; static PyObject *__pyx_n_TCP_OPT_NOP; static PyObject *__pyx_n_TCP_OPT_MSS; static PyObject *__pyx_n_TCP_OPT_WSCALE; static PyObject *__pyx_n_TCP_OPT_SACKOK; static PyObject *__pyx_n_TCP_OPT_SACK; static PyObject *__pyx_n_TCP_OPT_ECHO; static PyObject *__pyx_n_TCP_OPT_ECHOREPLY; static PyObject *__pyx_n_TCP_OPT_TIMESTAMP; static PyObject *__pyx_n_TCP_OPT_POCONN; static PyObject *__pyx_n_TCP_OPT_POSVC; static PyObject *__pyx_n_TCP_OPT_CC; static PyObject *__pyx_n_TCP_OPT_CCNEW; static PyObject *__pyx_n_TCP_OPT_CCECHO; static PyObject *__pyx_n_TCP_OPT_ALTSUM; static PyObject *__pyx_n_TCP_OPT_ALTSUMDATA; static PyObject *__pyx_n_TCP_OPT_SKEETER; static PyObject *__pyx_n_TCP_OPT_BUBBA; static PyObject *__pyx_n_TCP_OPT_TRAILSUM; static PyObject *__pyx_n_TCP_OPT_MD5; static PyObject *__pyx_n_TCP_OPT_SCPS; static PyObject *__pyx_n_TCP_OPT_SNACK; static PyObject *__pyx_n_TCP_OPT_REC; static PyObject *__pyx_n_TCP_OPT_CORRUPT; static PyObject *__pyx_n_TCP_OPT_SNAP; static PyObject *__pyx_n_TCP_OPT_TCPCOMP; static PyObject *__pyx_n_TCP_OPT_MAX; static PyObject *__pyx_n_tcp_pack_hdr; static PyObject *__pyx_n_UDP_HDR_LEN; static PyObject *__pyx_n_UDP_PORT_MAX; static PyObject *__pyx_n_udp_pack_hdr; static PyObject *__pyx_n_INTF_TYPE_OTHER; static PyObject *__pyx_n_INTF_TYPE_ETH; static PyObject *__pyx_n_INTF_TYPE_LOOPBACK; static PyObject *__pyx_n_INTF_TYPE_TUN; static PyObject *__pyx_n_INTF_FLAG_UP; static PyObject *__pyx_n_INTF_FLAG_LOOPBACK; static PyObject *__pyx_n_INTF_FLAG_POINTOPOINT; static PyObject *__pyx_n_INTF_FLAG_NOARP; static PyObject *__pyx_n_INTF_FLAG_BROADCAST; static PyObject *__pyx_n_INTF_FLAG_MULTICAST; static PyObject *__pyx_n_FW_OP_ALLOW; static PyObject *__pyx_n_FW_OP_BLOCK; static PyObject *__pyx_n_FW_DIR_IN; static PyObject *__pyx_n_FW_DIR_OUT; static PyObject *__pyx_n_BSD; static PyObject *__pyx_k9p; static PyObject *__pyx_k10p; static PyObject *__pyx_k12p; static PyObject *__pyx_k13p; static PyObject *__pyx_n_ValueError; static PyObject *__pyx_k60p; static char (__pyx_k60[]) = "not a %d-byte binary string: %r"; static PyObject *__pyx_f_4dnet___memcpy(char (*__pyx_v_dst),PyObject *__pyx_v_src,int __pyx_v_n) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; char (*__pyx_5); Py_INCREF(__pyx_v_src); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":44 */ __pyx_1 = (PyString_Size(__pyx_v_src) != __pyx_v_n); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":45 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(__pyx_v_n); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); Py_INCREF(__pyx_v_src); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_src); __pyx_3 = 0; __pyx_3 = PyNumber_Remainder(__pyx_k60p, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":46 */ __pyx_5 = PyString_AsString(__pyx_v_src); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} memcpy(__pyx_v_dst,__pyx_5,__pyx_v_n); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.__memcpy"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_src); return __pyx_r; } static PyObject *__pyx_f_4dnet___oserror(void) { __PYX_EXTERN_C int errno; PyObject *__pyx_r; PyObject *__pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":50 */ __pyx_1 = PyString_FromString(strerror(errno)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.__oserror"); __pyx_r = 0; __pyx_L0:; return __pyx_r; } static PyObject *__pyx_n_append; static PyObject *__pyx_f_4dnet___iter_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet___iter_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_entry = 0; PyObject *__pyx_v_l = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"entry","l",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_entry, &__pyx_v_l)) return 0; Py_INCREF(__pyx_v_entry); Py_INCREF(__pyx_v_l); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":53 */ __pyx_1 = PyObject_GetAttr(__pyx_v_l, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_INCREF(__pyx_v_entry); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_entry); __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__iter_append"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_entry); Py_DECREF(__pyx_v_l); return __pyx_r; } static PyObject *__pyx_n_OSError; static int __pyx_f_4dnet_3eth___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3eth___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_device = 0; int __pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"device",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_device)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_device); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":110 */ __pyx_1 = PyString_AsString(__pyx_v_device); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;} ((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth = eth_open(__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":111 */ __pyx_2 = (!(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth != 0)); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":112 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} __pyx_4 = __pyx_f_4dnet___oserror(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_4, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.eth.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_device); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_get[] = "Return the MAC address associated with the device as a\n binary string."; static PyObject *__pyx_f_4dnet_3eth_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { eth_addr_t __pyx_v_ea; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":118 */ __pyx_1 = (eth_get(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,(&__pyx_v_ea)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":119 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":120 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_ea.data,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_set[] = "Set the MAC address for the device, returning 0 on success,\n -1 on failure.\n \n Arguments:\n eth_addr -- 6-byte binary string (e.g. \'\\x00\\xde\\xad\\xbe\\xef\\x00\')\n "; static PyObject *__pyx_f_4dnet_3eth_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_value = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"value",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_value)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":130 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_ea.data,__pyx_v_value,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":131 */ __pyx_2 = (eth_set(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,(&__pyx_v_ea)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":132 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_send[] = "Send an Ethernet frame, returning the number of bytes sent\n or -1 on failure.\n \n Arguments:\n frame -- binary string representing an Ethernet frame\n "; static PyObject *__pyx_f_4dnet_3eth_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frame = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"frame",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_frame)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_frame); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":141 */ __pyx_1 = PyString_AsString(__pyx_v_frame); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(eth_send(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,__pyx_1,PyString_Size(__pyx_v_frame))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.eth.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_frame); return __pyx_r; } static void __pyx_f_4dnet_3eth___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3eth___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":144 */ __pyx_1 = (((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":145 */ eth_close(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.eth.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_eth_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_ntoa[] = "Convert an Ethernet MAC address from 6-byte packed binary string to\n a printable string (\'00:de:ad:be:ef:00\')."; static PyObject *__pyx_f_4dnet_eth_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":151 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_ea.data,__pyx_v_buf,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":152 */ __pyx_1 = PyString_FromString(eth_ntoa((&__pyx_v_ea))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.eth_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k61p; static char (__pyx_k61[]) = "invalid Ethernet address"; static PyObject *__pyx_f_4dnet_eth_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_aton[] = "Convert an Ethernet MAC address from a printable string to a\n packed binary string (\'\\x00\\xde\\xad\\xbe\\xef\\x00\')."; static PyObject *__pyx_f_4dnet_eth_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":158 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} __pyx_2 = (eth_aton(__pyx_1,(&__pyx_v_ea)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":159 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k61p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":160 */ __pyx_3 = PyString_FromStringAndSize(__pyx_v_ea.data,6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_eth_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_pack_hdr[] = "Return a packed binary string representing an Ethernet header.\n \n Keyword arguments:\n dst -- destination address (6-byte binary string)\n src -- source address (6-byte binary string)\n type -- Ethernet payload type (ETH_TYPE_*) (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_eth_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dst = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_type = 0; char (__pyx_v_hdr[14]); eth_addr_t __pyx_v_s; eth_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"dst","src","type",0}; __pyx_v_dst = __pyx_k16; __pyx_v_src = __pyx_k17; __pyx_v_type = __pyx_k18; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_dst, &__pyx_v_src, &__pyx_v_type)) return 0; Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":173 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_s.data,__pyx_v_src,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":174 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_d.data,__pyx_v_dst,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":175 */ __pyx_2 = PyInt_AsLong(__pyx_v_type); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} eth_pack_hdr(__pyx_v_hdr,__pyx_v_d,__pyx_v_s,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":176 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,14); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.eth_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_type); return __pyx_r; } static int __pyx_f_4dnet_2ip___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_2ip___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":248 */ ((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip = ip_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":249 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":250 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_2ip_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2ip_send[] = "Send an IP packet, returning the number of bytes sent\n or -1 on failure.\n\n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_2ip_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pkt); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":259 */ __pyx_1 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(ip_send(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip,__pyx_1,PyString_Size(__pyx_v_pkt))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static void __pyx_f_4dnet_2ip___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_2ip___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":262 */ __pyx_1 = (((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":263 */ ip_close(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.ip.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_ip_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_ntoa[] = "Convert an IP address from a 4-byte packed binary string or\n integer to a printable string (\'10.0.0.1\')."; static PyObject *__pyx_f_4dnet_ip_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip_addr_t __pyx_v_ia; unsigned int __pyx_v_i; PyObject *__pyx_r; int __pyx_1; unsigned long __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":271 */ __pyx_1 = PyInt_Check(__pyx_v_buf); if (!__pyx_1) { __pyx_1 = PyLong_Check(__pyx_v_buf); } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":272 */ __pyx_2 = PyInt_AsUnsignedLongMask(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} __pyx_v_i = ntohl(__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":273 */ memcpy(((char (*))(&__pyx_v_ia)),((char (*))(&__pyx_v_i)),4); goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":275 */ __pyx_3 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_ia)),__pyx_v_buf,4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":276 */ __pyx_3 = PyString_FromString(ip_ntoa((&__pyx_v_ia))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k62p; static char (__pyx_k62[]) = "invalid IP address"; static PyObject *__pyx_f_4dnet_ip_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_aton[] = "Convert an IP address from a printable string to a\n packed binary string (\'\\x0a\\x00\\x00\\x01\')."; static PyObject *__pyx_f_4dnet_ip_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip_addr_t __pyx_v_ia; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":282 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} __pyx_2 = (ip_aton(__pyx_1,(&__pyx_v_ia)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":283 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k62p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":284 */ __pyx_3 = PyString_FromStringAndSize(((char (*))(&__pyx_v_ia)),4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_n_TypeError; static PyObject *__pyx_f_4dnet_ip_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_checksum[] = "Return packed binary string representing an IP packet \n with the IP and transport-layer checksums set.\n \n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_ip_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; char (__pyx_v_buf[2048]); char (*__pyx_v_p); int __pyx_v_n; PyObject *__pyx_v_s; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; char (*__pyx_3); static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_pkt); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":296 */ __pyx_1 = (PyObject_AsReadBuffer(__pyx_v_pkt,(&__pyx_v_p),(&__pyx_v_n)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":297 */ __pyx_1 = (__pyx_v_n < 2048); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":298 */ memcpy(__pyx_v_buf,__pyx_v_p,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":299 */ ip_checksum(__pyx_v_buf,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":300 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_buf,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":301 */ __pyx_v_p = malloc(__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":302 */ __pyx_3 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} memcpy(__pyx_v_p,__pyx_3,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":303 */ ip_checksum(__pyx_v_p,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":304 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_p,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":305 */ free(__pyx_v_p); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":306 */ Py_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":307 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip_checksum"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_cksum_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_ip_cksum_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; int __pyx_v_sum; char (*__pyx_v_p); int __pyx_v_n; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"buf","sum",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "Oi", __pyx_argnames, &__pyx_v_buf, &__pyx_v_sum)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":312 */ __pyx_1 = (PyObject_AsReadBuffer(__pyx_v_buf,(&__pyx_v_p),(&__pyx_v_n)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":313 */ __pyx_2 = PyInt_FromLong(ip_cksum_add(__pyx_v_p,__pyx_v_n,__pyx_v_sum)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":315 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip_cksum_add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_cksum_carry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_ip_cksum_carry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sum; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"sum",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_sum)) return 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":318 */ __pyx_1 = PyInt_FromLong(ip_cksum_carry(__pyx_v_sum)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip_cksum_carry"); __pyx_r = 0; __pyx_L0:; return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_pack_hdr[] = "Return a packed binary string representing an IP header.\n \n Keyword arguments:\n tos -- type of service (8-bit integer)\n len -- length (IP_HDR_LEN + payload) (16-bit integer)\n id -- packet ID (16-bit integer)\n off -- fragmentation offset (16-bit integer)\n ttl -- time-to-live (8-bit integer)\n p -- protocol (IP_PROTO_*) (8-bit integer)\n src -- source address (4-byte binary string)\n dst -- destination address (4-byte binary string)\n "; static PyObject *__pyx_f_4dnet_ip_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tos = 0; PyObject *__pyx_v_len = 0; PyObject *__pyx_v_id = 0; PyObject *__pyx_v_off = 0; PyObject *__pyx_v_ttl = 0; PyObject *__pyx_v_p = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_dst = 0; char (__pyx_v_hdr[20]); ip_addr_t __pyx_v_s; ip_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; int __pyx_3; int __pyx_4; int __pyx_5; int __pyx_6; int __pyx_7; static char *__pyx_argnames[] = {"tos","len","id","off","ttl","p","src","dst",0}; __pyx_v_tos = __pyx_k24; __pyx_v_len = __pyx_k25; __pyx_v_id = __pyx_k26; __pyx_v_off = __pyx_k27; __pyx_v_ttl = __pyx_k28; __pyx_v_p = __pyx_k29; __pyx_v_src = __pyx_k30; __pyx_v_dst = __pyx_k31; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOO", __pyx_argnames, &__pyx_v_tos, &__pyx_v_len, &__pyx_v_id, &__pyx_v_off, &__pyx_v_ttl, &__pyx_v_p, &__pyx_v_src, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_tos); Py_INCREF(__pyx_v_len); Py_INCREF(__pyx_v_id); Py_INCREF(__pyx_v_off); Py_INCREF(__pyx_v_ttl); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":337 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_s)),__pyx_v_src,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":338 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_d)),__pyx_v_dst,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":339 */ __pyx_2 = PyInt_AsLong(__pyx_v_tos); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_v_id); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_off); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_ttl); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_7 = PyInt_AsLong(__pyx_v_p); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} ip_pack_hdr(__pyx_v_hdr,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_v_s,__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":340 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,20); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_tos); Py_DECREF(__pyx_v_len); Py_DECREF(__pyx_v_id); Py_DECREF(__pyx_v_off); Py_DECREF(__pyx_v_ttl); Py_DECREF(__pyx_v_p); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_ntoa[] = "Convert an IPv6 address from a 16-byte packed binary string to a\n printable string (\'10.0.0.1\')."; static PyObject *__pyx_f_4dnet_ip6_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip6_addr_t __pyx_v_ia; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":374 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_ia)),__pyx_v_buf,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":375 */ __pyx_1 = PyString_FromString(ip6_ntoa((&__pyx_v_ia))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip6_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k63p; static char (__pyx_k63[]) = "invalid IPv6 address"; static PyObject *__pyx_f_4dnet_ip6_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_aton[] = "Convert an IPv6 address from a printable string to a\n packed binary string (\'\\x0a\\x00\\x00\\x01\')."; static PyObject *__pyx_f_4dnet_ip6_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip6_addr_t __pyx_v_ia; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":381 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;} __pyx_2 = (ip6_aton(__pyx_1,(&__pyx_v_ia)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":382 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k63p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":383 */ __pyx_3 = PyString_FromStringAndSize(((char (*))(&__pyx_v_ia)),16); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip6_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_checksum[] = "Return a packed binary string representing an IPv6 packet \n with the IPv6 and transport-layer checksums set.\n\n Arguments:\n pkt -- binary string representing an IPv6 packet\n "; static PyObject *__pyx_f_4dnet_ip6_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":392 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} ip6_checksum(__pyx_1,PyString_Size(__pyx_v_buf)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":393 */ Py_INCREF(__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.ip6_checksum"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_pack_hdr[] = "Return a packed binary string representing an IPv6 header.\n \n Keyword arguments:\n fc -- flow class (8-bit integer)\n fl -- flow label (20-bit integer)\n plen -- payload length (16-bit integer)\n nxt -- next header (IP_PROTO_*) (8-bit integer)\n hlim -- hop limit (8-bit integer)\n src -- source address (16-byte binary string)\n dst -- destination address (16-byte binary string)\n "; static PyObject *__pyx_f_4dnet_ip6_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fc = 0; PyObject *__pyx_v_fl = 0; PyObject *__pyx_v_plen = 0; PyObject *__pyx_v_nxt = 0; PyObject *__pyx_v_hlim = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_dst = 0; char (__pyx_v_hdr[40]); ip6_addr_t __pyx_v_s; ip6_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; int __pyx_3; int __pyx_4; int __pyx_5; int __pyx_6; static char *__pyx_argnames[] = {"fc","fl","plen","nxt","hlim","src","dst",0}; __pyx_v_fc = __pyx_k34; __pyx_v_fl = __pyx_k35; __pyx_v_plen = __pyx_k36; __pyx_v_nxt = __pyx_k37; __pyx_v_hlim = __pyx_k38; __pyx_v_src = __pyx_k39; __pyx_v_dst = __pyx_k40; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOO", __pyx_argnames, &__pyx_v_fc, &__pyx_v_fl, &__pyx_v_plen, &__pyx_v_nxt, &__pyx_v_hlim, &__pyx_v_src, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_fc); Py_INCREF(__pyx_v_fl); Py_INCREF(__pyx_v_plen); Py_INCREF(__pyx_v_nxt); Py_INCREF(__pyx_v_hlim); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":410 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_s)),__pyx_v_src,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":411 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_d)),__pyx_v_dst,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":412 */ __pyx_2 = PyInt_AsLong(__pyx_v_fc); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_fl); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_v_plen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_nxt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_hlim); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} ip6_pack_hdr(__pyx_v_hdr,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_v_s,__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":413 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,40); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip6_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_fc); Py_DECREF(__pyx_v_fl); Py_DECREF(__pyx_v_plen); Py_DECREF(__pyx_v_nxt); Py_DECREF(__pyx_v_hlim); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_n_ip; static PyObject *__pyx_k64p; static char (__pyx_k64[]) = "invalid network address"; static int __pyx_f_4dnet_4addr___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4addr___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addrtxt = 0; PyObject *__pyx_v_type = 0; int __pyx_r; int __pyx_1; char (*__pyx_2); PyObject *__pyx_3 = 0; unsigned short __pyx_4; static char *__pyx_argnames[] = {"addrtxt","type",0}; __pyx_v_addrtxt = __pyx_k41; __pyx_v_type = __pyx_k42; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_addrtxt, &__pyx_v_type)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_addrtxt); Py_INCREF(__pyx_v_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":445 */ if (PyObject_Cmp(__pyx_v_addrtxt, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; if (__pyx_1) { __pyx_2 = PyString_AsString(__pyx_v_addrtxt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} __pyx_1 = (addr_aton(__pyx_2,(&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr)) < 0); } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":446 */ __pyx_1 = (PyString_Size(__pyx_v_addrtxt) == 4); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":447 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":448 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":449 */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_ip, __pyx_v_addrtxt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} goto __pyx_L3; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":451 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k64p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_addrtxt); Py_DECREF(__pyx_v_type); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_4type___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4type___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":456 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.addr.type.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_OverflowError; static int __pyx_f_4dnet_4addr_4type___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_f_4dnet_4addr_4type___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { unsigned int __pyx_v_value; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_value = PyInt_AsUnsignedLongMask(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":458 */ __pyx_1 = (__pyx_v_value > 65535); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":459 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_v_value; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.type.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_4bits___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4bits___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":464 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.addr.bits.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_4addr_4bits___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_f_4dnet_4addr_4bits___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { unsigned int __pyx_v_value; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_value = PyInt_AsUnsignedLongMask(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":466 */ __pyx_1 = (__pyx_v_value > 65535); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":467 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_v_value; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.bits.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_eth; static PyObject *__pyx_n_ip6; static PyObject *__pyx_k65p; static char (__pyx_k65[]) = "invalid network address"; static PyObject *__pyx_f_4dnet_4addr_4data___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4data___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":472 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":473 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_eth); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_2 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":475 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ip); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":477 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ip6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":479 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k65p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.data.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k66p; static char (__pyx_k66[]) = "non-Ethernet address"; static PyObject *__pyx_f_4dnet_4addr_3eth___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_3eth___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":484 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":485 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k66p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":486 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.eth.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k67p; static char (__pyx_k67[]) = "not a 6-byte string"; static int __pyx_f_4dnet_4addr_3eth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_3eth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":489 */ __pyx_1 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":490 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k67p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":491 */ __pyx_2 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":492 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":493 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BITS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.eth.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_k68p; static char (__pyx_k68[]) = "non-IP address"; static PyObject *__pyx_f_4dnet_4addr_2ip___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_2ip___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":498 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":499 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k68p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":500 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k69p; static char (__pyx_k69[]) = "not a 4-byte string"; static int __pyx_f_4dnet_4addr_2ip___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_2ip___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":504 */ __pyx_1 = PyInt_Check(__pyx_v_value); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":505 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip = htonl(PyInt_AsLong(__pyx_v_value)); goto __pyx_L2; } __pyx_1 = PyLong_Check(__pyx_v_value); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":507 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip = htonl(PyLong_AsUnsignedLong(__pyx_v_value)); goto __pyx_L2; } __pyx_2 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_LEN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":509 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k69p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;} goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":511 */ __pyx_3 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":512 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":513 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.ip.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_k70p; static char (__pyx_k70[]) = "non-IPv6 address"; static PyObject *__pyx_f_4dnet_4addr_3ip6___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_3ip6___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":518 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":519 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k70p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":520 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,16); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip6.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k71p; static char (__pyx_k71[]) = "not a 16-byte string"; static int __pyx_f_4dnet_4addr_3ip6___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_3ip6___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":523 */ __pyx_1 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":524 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k71p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":525 */ __pyx_2 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,16); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":526 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":527 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_BITS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip6.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_bcast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4addr_bcast[] = "Return an addr object for our broadcast address."; static PyObject *__pyx_f_4dnet_4addr_bcast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bcast; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_bcast = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":531 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_bcast); __pyx_v_bcast = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":532 */ addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_bcast)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":533 */ Py_INCREF(__pyx_v_bcast); __pyx_r = __pyx_v_bcast; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.bcast"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_bcast); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_net(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4addr_net[] = "Return an addr object for our network address."; static PyObject *__pyx_f_4dnet_4addr_net(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_net; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_net = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":537 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_net); __pyx_v_net = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":538 */ addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_net)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":539 */ Py_INCREF(__pyx_v_net); __pyx_r = __pyx_v_net; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.net"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_net); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_NotImplementedError; static PyObject *__pyx_n___copy__; static PyObject *__pyx_f_4dnet_4addr___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x; PyObject *__pyx_v_y; PyObject *__pyx_v_z; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; unsigned long __pyx_5; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_other); __pyx_v_x = Py_None; Py_INCREF(Py_None); __pyx_v_y = Py_None; Py_INCREF(Py_None); __pyx_v_z = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":543 */ __pyx_1 = PyInt_Check(__pyx_v_self); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":544 */ __pyx_2 = __pyx_v_other; Py_INCREF(__pyx_2); __pyx_3 = __pyx_v_self; Py_INCREF(__pyx_3); Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_2; __pyx_2 = 0; Py_DECREF(__pyx_v_y); __pyx_v_y = __pyx_3; __pyx_3 = 0; goto __pyx_L2; } __pyx_1 = PyInt_Check(__pyx_v_other); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":546 */ __pyx_2 = __pyx_v_self; Py_INCREF(__pyx_2); __pyx_3 = __pyx_v_other; Py_INCREF(__pyx_3); Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_2; __pyx_2 = 0; Py_DECREF(__pyx_v_y); __pyx_v_y = __pyx_3; __pyx_3 = 0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":548 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":549 */ __pyx_3 = PyObject_GetAttr(__pyx_v_x, __pyx_n___copy__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_z); __pyx_v_z = __pyx_4; __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":550 */ __pyx_3 = PyLong_FromUnsignedLong(ntohl(((struct __pyx_obj_4dnet_addr *)__pyx_v_x)->_addr.addr_ip)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} __pyx_2 = PyNumber_Add(__pyx_3, __pyx_v_y); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_z)->_addr.addr_ip = htonl(__pyx_5); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":551 */ Py_INCREF(__pyx_v_z); __pyx_r = __pyx_v_z; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.addr.__add__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_x); Py_DECREF(__pyx_v_y); Py_DECREF(__pyx_v_z); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_other); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_a; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_a = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":554 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":555 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_a)->_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":556 */ Py_INCREF(__pyx_v_a); __pyx_r = __pyx_v_a; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__copy__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_4addr___cmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/ static int __pyx_f_4dnet_4addr___cmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y) { int __pyx_v_i; int __pyx_r; int __pyx_1; Py_INCREF(__pyx_v_x); Py_INCREF(__pyx_v_y); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4dnet_addr, 1, "y")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":560 */ __pyx_v_i = addr_cmp((&((struct __pyx_obj_4dnet_addr *)__pyx_v_x)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_y)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":561 */ __pyx_1 = (__pyx_v_i < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":562 */ __pyx_r = (-1); goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":563 */ __pyx_1 = (__pyx_v_i > 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":564 */ __pyx_r = 1; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":565 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.addr.__cmp__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_x); Py_DECREF(__pyx_v_y); return __pyx_r; } static int __pyx_f_4dnet_4addr___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static int __pyx_f_4dnet_4addr___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { struct addr __pyx_v_s1; struct addr __pyx_v_s2; struct addr __pyx_v_o1; struct addr __pyx_v_o2; int __pyx_r; int __pyx_1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_other); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4dnet_addr, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":569 */ __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_s1)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_s2)) != 0); if (!__pyx_1) { __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_other)->_addr),(&__pyx_v_o1)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_other)->_addr),(&__pyx_v_o2)) != 0); } } } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":573 */ __pyx_r = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":574 */ __pyx_1 = (addr_cmp((&__pyx_v_o1),(&__pyx_v_s1)) >= 0); if (__pyx_1) { __pyx_1 = (addr_cmp((&__pyx_v_o2),(&__pyx_v_s2)) <= 0); } __pyx_r = __pyx_1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.addr.__contains__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_other); return __pyx_r; } static long __pyx_f_4dnet_4addr___hash__(PyObject *__pyx_v_self); /*proto*/ static long __pyx_f_4dnet_4addr___hash__(PyObject *__pyx_v_self) { long __pyx_v_x; long __pyx_v_y; long __pyx_v_size; PyObject *__pyx_v_i; long __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; long __pyx_4; Py_ssize_t __pyx_5; Py_INCREF(__pyx_v_self); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":578 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 6; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 4; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 16; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":581 */ __pyx_v_x = 3430008; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":582 */ __pyx_v_x = (__pyx_v_x ^ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":583 */ __pyx_v_x = (__pyx_v_x ^ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":584 */ __pyx_v_y = ((((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8[0]) << 7); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":585 */ for (__pyx_4 = 0+1; __pyx_4 < __pyx_v_size; ++__pyx_4) { __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":586 */ __pyx_5 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;} __pyx_v_y = ((1000003 * __pyx_v_y) ^ (((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8[__pyx_5])); __pyx_L3:; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":587 */ __pyx_v_y = (__pyx_v_y ^ __pyx_v_size); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":588 */ __pyx_3 = (__pyx_v_y == (-1)); if (__pyx_3) { __pyx_v_y = (-2); goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":589 */ __pyx_v_x = (__pyx_v_x ^ __pyx_v_y); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":590 */ __pyx_3 = (__pyx_v_x == (-1)); if (__pyx_3) { __pyx_v_x = (-2); goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":591 */ __pyx_r = __pyx_v_x; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__hash__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___int__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":594 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":595 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} __Pyx_Raise(__pyx_1, 0, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":596 */ __pyx_2 = PyLong_FromUnsignedLong(ntohl(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__int__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n___int__; static PyObject *__pyx_f_4dnet_4addr___long__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___long__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":599 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___int__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.__long__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___iter__(PyObject *__pyx_v_self) { struct addr __pyx_v_a; struct addr __pyx_v_b; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":603 */ __pyx_2 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (!__pyx_1) { __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_a)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_b)) != 0); } } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":606 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":615 */ __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_a.addr_ip); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_b.addr_ip); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); __pyx_3 = 0; __pyx_2 = 0; __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___addr_ip4_iter), __pyx_4, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.addr.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k72p; static char (__pyx_k72[]) = ""; static PyObject *__pyx_f_4dnet_4addr___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___repr__(PyObject *__pyx_v_self) { char (*__pyx_v_p); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":619 */ __pyx_v_p = addr_ntoa((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":620 */ __pyx_1 = (!(__pyx_v_p != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":621 */ Py_INCREF(__pyx_k72p); __pyx_r = __pyx_k72p; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":622 */ __pyx_2 = PyString_FromString(__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__repr__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_15__addr_ip4_iter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_15__addr_ip4_iter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cur = 0; PyObject *__pyx_v_max = 0; int __pyx_r; unsigned long __pyx_1; static char *__pyx_argnames[] = {"cur","max",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_cur, &__pyx_v_max)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_cur); Py_INCREF(__pyx_v_max); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":629 */ __pyx_1 = PyInt_AsUnsignedLongMask(__pyx_v_cur); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur = ntohl(__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":630 */ __pyx_1 = PyInt_AsUnsignedLongMask(__pyx_v_max); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;} ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->max = ntohl(__pyx_1); __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__addr_ip4_iter.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_cur); Py_DECREF(__pyx_v_max); return __pyx_r; } static PyObject *__pyx_n_StopIteration; static PyObject *__pyx_f_4dnet_15__addr_ip4_iter___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_15__addr_ip4_iter___next__(PyObject *__pyx_v_self) { struct __pyx_obj_4dnet_addr *__pyx_v_next; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); __pyx_v_next = ((struct __pyx_obj_4dnet_addr *)Py_None); Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":634 */ __pyx_1 = (((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur <= ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":635 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4dnet_addr)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_next)); __pyx_v_next = ((struct __pyx_obj_4dnet_addr *)__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":636 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_next->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":637 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_next->_addr.addr_bits = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":638 */ __pyx_v_next->_addr.addr_ip = htonl(((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":639 */ ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur = (((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":640 */ Py_INCREF(((PyObject *)__pyx_v_next)); __pyx_r = ((PyObject *)__pyx_v_next); goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":642 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__addr_ip4_iter.__next__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_next); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet___arp_callback(struct arp_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_pa; PyObject *__pyx_v_ha; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_pa = Py_None; Py_INCREF(Py_None); __pyx_v_ha = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":680 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":681 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_pa); __pyx_v_pa = __pyx_3; __pyx_3 = 0; Py_DECREF(__pyx_v_ha); __pyx_v_ha = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":682 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_pa)->_addr = __pyx_v_entry->arp_pa; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":683 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_ha)->_addr = __pyx_v_entry->arp_ha; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":684 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_INCREF(__pyx_v_pa); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_pa); Py_INCREF(__pyx_v_ha); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_ha); __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_1 = 0; __pyx_2 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":685 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":686 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":687 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__arp_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_pa); Py_DECREF(__pyx_v_ha); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_3arp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3arp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":697 */ ((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp = arp_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":698 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":699 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_add[] = "Add an entry to the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n ha -- ADDR_TYPE_ETH network address object\n "; static PyObject *__pyx_f_4dnet_3arp_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct __pyx_obj_4dnet_addr *__pyx_v_ha = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa","ha",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_pa, &__pyx_v_ha)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); Py_INCREF(__pyx_v_ha); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ha), __pyx_ptype_4dnet_addr, 1, "ha")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":709 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":710 */ __pyx_v_entry.arp_ha = __pyx_v_ha->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":711 */ __pyx_1 = (arp_add(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":712 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); Py_DECREF(__pyx_v_ha); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_delete[] = "Delete an entry from the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_3arp_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pa)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":721 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":722 */ __pyx_1 = (arp_delete(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":723 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_get[] = "Return the hardware address for a given protocol address\n in the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_3arp_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pa)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":733 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":734 */ __pyx_1 = (arp_get(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":735 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry.arp_ha))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":736 */ Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_loop[] = "Iterate over the system ARP table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with ((pa, ha), arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_3arp_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k43; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":748 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":749 */ __pyx_1 = PyInt_FromLong(arp_loop(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,__pyx_f_4dnet___arp_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.arp.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_n_loop; static PyObject *__pyx_n_iter; static PyObject *__pyx_f_4dnet_3arp___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3arp___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":752 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":753 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":754 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_3arp___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3arp___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":757 */ __pyx_1 = (((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":758 */ arp_close(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.arp.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_arp_pack_hdr_ethip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_arp_pack_hdr_ethip[] = "Return a packed binary string representing an Ethernet/IP ARP message.\n \n Keyword arguments:\n op -- operation (ARP_OP_*) (16-bit integer)\n sha -- sender Ethernet address (6-byte binary string)\n spa -- sender IP address (4-byte binary string)\n dha -- destination Ethernet address (6-byte binary string)\n dpa -- destination IP address (4-byte binary string)\n "; static PyObject *__pyx_f_4dnet_arp_pack_hdr_ethip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_op = 0; PyObject *__pyx_v_sha = 0; PyObject *__pyx_v_spa = 0; PyObject *__pyx_v_dha = 0; PyObject *__pyx_v_dpa = 0; char (__pyx_v_buf[28]); eth_addr_t __pyx_v_sh; eth_addr_t __pyx_v_dh; ip_addr_t __pyx_v_sp; ip_addr_t __pyx_v_dp; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"op","sha","spa","dha","dpa",0}; __pyx_v_op = __pyx_k44; __pyx_v_sha = __pyx_k45; __pyx_v_spa = __pyx_k46; __pyx_v_dha = __pyx_k47; __pyx_v_dpa = __pyx_k48; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOO", __pyx_argnames, &__pyx_v_op, &__pyx_v_sha, &__pyx_v_spa, &__pyx_v_dha, &__pyx_v_dpa)) return 0; Py_INCREF(__pyx_v_op); Py_INCREF(__pyx_v_sha); Py_INCREF(__pyx_v_spa); Py_INCREF(__pyx_v_dha); Py_INCREF(__pyx_v_dpa); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":775 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_sh.data,__pyx_v_sha,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":776 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_dh.data,__pyx_v_dha,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":777 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_sp)),__pyx_v_spa,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":778 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_dp)),__pyx_v_dpa,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":779 */ __pyx_2 = PyInt_AsLong(__pyx_v_op); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} arp_pack_hdr_ethip(__pyx_v_buf,__pyx_2,__pyx_v_sh,__pyx_v_sp,__pyx_v_dh,__pyx_v_dp); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":780 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_buf,28); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.arp_pack_hdr_ethip"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_op); Py_DECREF(__pyx_v_sha); Py_DECREF(__pyx_v_spa); Py_DECREF(__pyx_v_dha); Py_DECREF(__pyx_v_dpa); return __pyx_r; } static PyObject *__pyx_f_4dnet_icmp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_icmp_pack_hdr[] = "Return a packed binary string representing an ICMP header.\n\n Keyword arguments:\n type -- ICMP type (8-bit integer)\n code -- ICMP code (8-bit integer)\n "; static PyObject *__pyx_f_4dnet_icmp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_code = 0; char (__pyx_v_buf[4]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"type","code",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_type, &__pyx_v_code)) return 0; Py_INCREF(__pyx_v_type); Py_INCREF(__pyx_v_code); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":796 */ __pyx_1 = PyInt_AsLong(__pyx_v_type); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} icmp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":797 */ __pyx_3 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.icmp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_type); Py_DECREF(__pyx_v_code); return __pyx_r; } static PyObject *__pyx_f_4dnet_tcp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_tcp_pack_hdr[] = "Return a packed binary string representing a TCP header.\n\n Keyword arguments:\n sport -- source port (16-bit integer)\n dport -- destination port (16-bit integer)\n seq -- sequence number (32-bit integer)\n ack -- acknowledgment number (32-bit integer)\n flags -- control flags (TH_*) (8-bit integer bitmask)\n win -- window size (16-bit integer)\n urp -- urgent pointer (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_tcp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sport = 0; PyObject *__pyx_v_dport = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_ack = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_win = 0; PyObject *__pyx_v_urp = 0; char (__pyx_v_buf[20]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; unsigned long __pyx_3; unsigned long __pyx_4; int __pyx_5; int __pyx_6; int __pyx_7; PyObject *__pyx_8 = 0; static char *__pyx_argnames[] = {"sport","dport","seq","ack","flags","win","urp",0}; __pyx_v_seq = __pyx_k49; __pyx_v_ack = __pyx_k50; __pyx_v_flags = __pyx_k51; __pyx_v_win = __pyx_k52; __pyx_v_urp = __pyx_k53; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|OOOOO", __pyx_argnames, &__pyx_v_sport, &__pyx_v_dport, &__pyx_v_seq, &__pyx_v_ack, &__pyx_v_flags, &__pyx_v_win, &__pyx_v_urp)) return 0; Py_INCREF(__pyx_v_sport); Py_INCREF(__pyx_v_dport); Py_INCREF(__pyx_v_seq); Py_INCREF(__pyx_v_ack); Py_INCREF(__pyx_v_flags); Py_INCREF(__pyx_v_win); Py_INCREF(__pyx_v_urp); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":862 */ __pyx_1 = PyInt_AsLong(__pyx_v_sport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_dport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_v_seq); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_ack); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_flags); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_win); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_7 = PyInt_AsLong(__pyx_v_urp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} tcp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":863 */ __pyx_8 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} __pyx_r = __pyx_8; __pyx_8 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_8); __Pyx_AddTraceback("dnet.tcp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_sport); Py_DECREF(__pyx_v_dport); Py_DECREF(__pyx_v_seq); Py_DECREF(__pyx_v_ack); Py_DECREF(__pyx_v_flags); Py_DECREF(__pyx_v_win); Py_DECREF(__pyx_v_urp); return __pyx_r; } static PyObject *__pyx_f_4dnet_udp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_udp_pack_hdr[] = "Return a packed binary string representing a UDP header.\n\n Keyword arguments:\n sport -- source port (16-bit integer)\n dport -- destination port (16-bit integer)\n ulen -- UDP header + data length (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_udp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sport = 0; PyObject *__pyx_v_dport = 0; PyObject *__pyx_v_ulen = 0; char (__pyx_v_buf[8]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; int __pyx_3; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"sport","dport","ulen",0}; __pyx_v_ulen = __pyx_k54; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_sport, &__pyx_v_dport, &__pyx_v_ulen)) return 0; Py_INCREF(__pyx_v_sport); Py_INCREF(__pyx_v_dport); Py_INCREF(__pyx_v_ulen); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":883 */ __pyx_1 = PyInt_AsLong(__pyx_v_sport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_dport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_ulen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} udp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2,__pyx_3); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":884 */ __pyx_4 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.udp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_sport); Py_DECREF(__pyx_v_dport); Py_DECREF(__pyx_v_ulen); return __pyx_r; } static PyObject *__pyx_n_name; static PyObject *__pyx_n_type; static PyObject *__pyx_n_flags; static PyObject *__pyx_n_mtu; static PyObject *__pyx_n_addr; static PyObject *__pyx_n_dst_addr; static PyObject *__pyx_n_link_addr; static PyObject *__pyx_n_alias_addrs; static PyObject *__pyx_f_4dnet_ifent_to_dict(struct intf_entry (*__pyx_v_entry)) { PyObject *__pyx_v_d; PyObject *__pyx_v_l; PyObject *__pyx_v_i; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; long __pyx_4; unsigned int __pyx_5; Py_ssize_t __pyx_6; PyObject *__pyx_7 = 0; __pyx_v_d = Py_None; Py_INCREF(Py_None); __pyx_v_l = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":926 */ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":927 */ __pyx_1 = PyString_FromString(__pyx_v_entry->intf_name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_name, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":928 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_type, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":929 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_flags, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":930 */ __pyx_1 = PyLong_FromUnsignedLong(__pyx_v_entry->intf_mtu); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_mtu, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":931 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":932 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_addr))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_addr, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":933 */ __pyx_2 = PyInt_FromLong(__pyx_v_entry->intf_dst_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":934 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_dst_addr))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dst_addr, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":935 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_link_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":936 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_link_addr))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_link_addr, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":937 */ __pyx_3 = (__pyx_v_entry->intf_alias_num > 0); if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":938 */ __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":939 */ __pyx_5 = __pyx_v_entry->intf_alias_num; for (__pyx_4 = 0; __pyx_4 < __pyx_5; ++__pyx_4) { __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":940 */ __pyx_2 = PyObject_GetAttr(__pyx_v_l, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_6 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_1 = PyString_FromString(addr_ntoa((&(__pyx_v_entry->intf_alias_addrs[__pyx_6])))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_7, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(__pyx_2, __pyx_7, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_7); __pyx_7 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_L6:; } __pyx_L7:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":941 */ if (PyObject_SetItem(__pyx_v_d, __pyx_n_alias_addrs, __pyx_v_l) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":942 */ Py_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_7); __Pyx_AddTraceback("dnet.ifent_to_dict"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_d); Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_i); return __pyx_r; } static PyObject *__pyx_n_len; static PyObject *__pyx_f_4dnet_dict_to_ifent(PyObject *__pyx_v_d,struct intf_entry (*__pyx_v_entry)) { PyObject *__pyx_v_s; PyObject *__pyx_v_i; PyObject *__pyx_r; PyObject *__pyx_1 = 0; char (*__pyx_2); int __pyx_3; unsigned short __pyx_4; unsigned int __pyx_5; PyObject *__pyx_6 = 0; PyObject *__pyx_7 = 0; long __pyx_8; Py_ssize_t __pyx_9; Py_INCREF(__pyx_v_d); __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":945 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":946 */ __pyx_2 = PyString_AsString(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} strlcpy(__pyx_v_entry->intf_name,__pyx_2,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":947 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_flags); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":948 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_entry->intf_flags = __pyx_4; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":949 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_mtu); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":950 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_mtu); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_entry->intf_mtu = __pyx_5; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":951 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":952 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} __pyx_v_entry->intf_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":953 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dst_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":954 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dst_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;} __pyx_v_entry->intf_dst_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":955 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_link_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":956 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_link_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;} __pyx_v_entry->intf_link_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":957 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_alias_addrs); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":958 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} __pyx_6 = PyObject_GetItem(__pyx_v_d, __pyx_n_alias_addrs); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6); __pyx_6 = 0; __pyx_6 = PyObject_Call(__pyx_1, __pyx_7, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_entry->intf_alias_num = __pyx_5; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":959 */ __pyx_5 = __pyx_v_entry->intf_alias_num; for (__pyx_8 = 0; __pyx_8 < __pyx_5; ++__pyx_8) { __pyx_1 = PyInt_FromLong(__pyx_8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":960 */ __pyx_7 = PyObject_GetItem(__pyx_v_d, __pyx_n_alias_addrs); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} __pyx_6 = PyObject_GetItem(__pyx_7, __pyx_v_i); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_9 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} (__pyx_v_entry->intf_alias_addrs[__pyx_9]) = ((struct __pyx_obj_4dnet_addr *)__pyx_6)->_addr; Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_L8:; } __pyx_L9:; goto __pyx_L7; } __pyx_L7:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_6); Py_XDECREF(__pyx_7); __Pyx_AddTraceback("dnet.dict_to_ifent"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_d); return __pyx_r; } static int __pyx_f_4dnet___intf_callback(struct intf_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":963 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":964 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_entry); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_2 = 0; __pyx_1 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":965 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":966 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":967 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__intf_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_4intf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4intf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":977 */ ((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf = intf_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":978 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":979 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get[] = "Return the configuration for a network interface as a dict.\n "; static PyObject *__pyx_f_4dnet_4intf_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"name",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_name)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_name); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":986 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":987 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":988 */ __pyx_1 = PyString_AsString(__pyx_v_name); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; goto __pyx_L1;} strlcpy(__pyx_v_ifent->intf_name,__pyx_1,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":989 */ __pyx_2 = (intf_get(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":990 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __pyx_4 = __pyx_f_4dnet___oserror(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_4, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":991 */ __pyx_3 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.intf.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_name); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get_src(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get_src[] = "Return the configuration for the interface whose primary address\n matches the specified source address.\n "; static PyObject *__pyx_f_4dnet_4intf_get_src(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_src = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"src",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_src)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_src); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_4dnet_addr, 1, "src")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":999 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1000 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1001 */ __pyx_1 = (intf_get_src(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent,(&__pyx_v_src->_addr)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1002 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1003 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.get_src"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_src); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get_dst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get_dst[] = "Return the configuration for the best interface with which to\n reach the specified dst address.\n "; static PyObject *__pyx_f_4dnet_4intf_get_dst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1011 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1012 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1013 */ __pyx_1 = (intf_get_dst(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent,(&__pyx_v_dst->_addr)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1014 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1015 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.get_dst"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_set[] = "Set the configuration for an interface from a dict.\n\n Dict values:\n name -- name of interface to set (string)\n flags -- interface flags (INTF_FLAG_*) (integer bitmask)\n mtu -- interface MTU (integer)\n addr -- primary network address (addr object)\n dst_addr -- point-to-point dst address (addr object)\n link_addr -- link-layer address (addr object)\n alias_addrs -- additional network addresses (list of addr objects)\n "; static PyObject *__pyx_f_4dnet_4intf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1031 */ memset(__pyx_v_buf,0,(sizeof(__pyx_v_buf))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1032 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1033 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1034 */ __pyx_1 = __pyx_f_4dnet_dict_to_ifent(__pyx_v_d,__pyx_v_ifent); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1035 */ __pyx_2 = (intf_set(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1036 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_loop[] = "Iterate over the system interface table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with (dict, arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_4intf_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k55; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1048 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1049 */ __pyx_1 = PyInt_FromLong(intf_loop(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_f_4dnet___intf_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.intf.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4intf___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1052 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1053 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1054 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_4intf___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_4intf___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1057 */ __pyx_1 = (((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1058 */ intf_close(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.intf.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static int __pyx_f_4dnet___route_callback(struct route_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_dst; PyObject *__pyx_v_gw; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_dst = Py_None; Py_INCREF(Py_None); __pyx_v_gw = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1079 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1080 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_dst); __pyx_v_dst = __pyx_3; __pyx_3 = 0; Py_DECREF(__pyx_v_gw); __pyx_v_gw = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1081 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_dst)->_addr = __pyx_v_entry->route_dst; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1082 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_gw)->_addr = __pyx_v_entry->route_gw; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1083 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_INCREF(__pyx_v_dst); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_dst); Py_INCREF(__pyx_v_gw); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_gw); __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_1 = 0; __pyx_2 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1084 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1085 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1086 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__route_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_gw); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_5route___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_5route___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1096 */ ((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route = route_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1097 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1098 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_add[] = "Add an entry to the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n gw -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct __pyx_obj_4dnet_addr *__pyx_v_gw = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst","gw",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_dst, &__pyx_v_gw)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_gw); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gw), __pyx_ptype_4dnet_addr, 1, "gw")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1108 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1109 */ __pyx_v_entry.route_gw = __pyx_v_gw->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1110 */ __pyx_1 = (route_add(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1111 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_gw); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_delete[] = "Delete an entry from the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1120 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1121 */ __pyx_1 = (route_delete(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1122 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_get[] = "Return the hardware address for a given protocol address\n in the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1132 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1133 */ __pyx_1 = (route_get(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1134 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry.route_gw))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1135 */ Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_loop[] = "Iterate over the system routing table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with ((dst, gw), arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_5route_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k56; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1147 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1148 */ __pyx_1 = PyInt_FromLong(route_loop(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,__pyx_f_4dnet___route_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.route.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_5route___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1151 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1152 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1153 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_5route___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_5route___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1156 */ __pyx_1 = (((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1157 */ route_close(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.route.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_n_device; static PyObject *__pyx_n_op; static PyObject *__pyx_n_dir; static PyObject *__pyx_n_proto; static PyObject *__pyx_n_src; static PyObject *__pyx_n_dst; static PyObject *__pyx_n_sport; static PyObject *__pyx_n_dport; static PyObject *__pyx_f_4dnet_rule_to_dict(struct fw_rule (*__pyx_v_rule)) { PyObject *__pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; int __pyx_4; PyObject *__pyx_5 = 0; __pyx_v_d = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1190 */ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1191 */ __pyx_1 = PyString_FromString(__pyx_v_rule->fw_device); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_device, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1192 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_op); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_op, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1193 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_dir); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_dir, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1194 */ __pyx_2 = (__pyx_v_rule->fw_proto != 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1195 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_proto, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1196 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_src.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_3, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} __pyx_2 = __pyx_2 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1197 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_rule->fw_src))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_src, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1198 */ __pyx_3 = PyInt_FromLong(__pyx_v_rule->fw_dst.addr_type); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} __pyx_2 = __pyx_2 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1199 */ __pyx_3 = PyString_FromString(addr_ntoa((&__pyx_v_rule->fw_dst))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dst, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1200 */ __pyx_2 = ((__pyx_v_rule->fw_sport[0]) == 0); if (__pyx_2) { __pyx_2 = ((__pyx_v_rule->fw_sport[1]) == 0); } __pyx_4 = (!__pyx_2); if (__pyx_4) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1201 */ __pyx_1 = PyInt_FromLong((__pyx_v_rule->fw_sport[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} __pyx_3 = PyInt_FromLong((__pyx_v_rule->fw_sport[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} __pyx_5 = PyList_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} PyList_SET_ITEM(__pyx_5, 0, __pyx_1); PyList_SET_ITEM(__pyx_5, 1, __pyx_3); __pyx_1 = 0; __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_sport, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1202 */ __pyx_2 = ((__pyx_v_rule->fw_dport[0]) == 0); if (__pyx_2) { __pyx_2 = ((__pyx_v_rule->fw_dport[1]) == 0); } __pyx_4 = (!__pyx_2); if (__pyx_4) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1203 */ __pyx_1 = PyInt_FromLong((__pyx_v_rule->fw_dport[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} __pyx_3 = PyInt_FromLong((__pyx_v_rule->fw_dport[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} __pyx_5 = PyList_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} PyList_SET_ITEM(__pyx_5, 0, __pyx_1); PyList_SET_ITEM(__pyx_5, 1, __pyx_3); __pyx_1 = 0; __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dport, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1204 */ Py_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_5); __Pyx_AddTraceback("dnet.rule_to_dict"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_dict_to_rule(PyObject *__pyx_v_d,struct fw_rule (*__pyx_v_rule)) { PyObject *__pyx_v_s; PyObject *__pyx_r; PyObject *__pyx_1 = 0; char (*__pyx_2); int __pyx_3; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; Py_INCREF(__pyx_v_d); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1207 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_device); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1208 */ __pyx_2 = PyString_AsString(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; goto __pyx_L1;} strlcpy(__pyx_v_rule->fw_device,__pyx_2,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1209 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_op); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_op = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1210 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dir); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_dir = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1211 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_proto); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1212 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_proto = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1213 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_TCP); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_4, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; if (!__pyx_3) { __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_UDP); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_4, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1214 */ (__pyx_v_rule->fw_sport[1]) = 65535; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1215 */ (__pyx_v_rule->fw_dport[1]) = 65535; goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1216 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_src); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1217 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_src); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; goto __pyx_L1;} __pyx_v_rule->fw_src = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1218 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dst); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1219 */ __pyx_4 = PyObject_GetItem(__pyx_v_d, __pyx_n_dst); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; goto __pyx_L1;} __pyx_v_rule->fw_dst = ((struct __pyx_obj_4dnet_addr *)__pyx_4)->_addr; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1220 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_sport); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1221 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_sport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_sport[0]) = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1222 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_sport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_sport[1]) = __pyx_3; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1223 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dport); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1224 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_dport[0]) = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1225 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_dport[1]) = __pyx_3; goto __pyx_L7; } __pyx_L7:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); __Pyx_AddTraceback("dnet.dict_to_rule"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_d); return __pyx_r; } static int __pyx_f_4dnet___fw_callback(struct fw_rule (*__pyx_v_rule),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1228 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1229 */ __pyx_2 = __pyx_f_4dnet_rule_to_dict(__pyx_v_rule); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_2 = 0; __pyx_1 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1230 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1231 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1232 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__fw_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_2fw___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_2fw___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1242 */ ((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw = fw_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1243 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1244 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_add[] = "Add a firewall rule specified as a dict.\n\n Dict values:\n device -- interface name (string)\n op -- operation (FW_OP_*) (integer)\n dir -- direction (FW_DIR_*) (integer)\n proto -- IP protocol (IP_PROTO_*) (integer)\n src -- source address / net (addr object)\n dst -- destination address / net (addr object)\n sport -- source port range or ICMP type/mask (list of 2 integers)\n dport -- dest port range or ICMP code/mask (list of 2 integers)\n "; static PyObject *__pyx_f_4dnet_2fw_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct fw_rule __pyx_v_rule; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1260 */ memset(((char (*))(&__pyx_v_rule)),0,(sizeof(__pyx_v_rule))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1261 */ __pyx_1 = __pyx_f_4dnet_dict_to_rule(__pyx_v_d,(&__pyx_v_rule)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1262 */ __pyx_2 = (fw_add(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,(&__pyx_v_rule)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1263 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_delete[] = "Delete a firewall rule specified as a dict."; static PyObject *__pyx_f_4dnet_2fw_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct fw_rule __pyx_v_rule; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1268 */ memset(((char (*))(&__pyx_v_rule)),0,(sizeof(__pyx_v_rule))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1269 */ __pyx_1 = __pyx_f_4dnet_dict_to_rule(__pyx_v_d,(&__pyx_v_rule)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1270 */ __pyx_2 = (fw_delete(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,(&__pyx_v_rule)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1271 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_loop[] = "Iterate over the local firewall ruleset, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with (dict, arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_2fw_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k57; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1283 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1284 */ __pyx_1 = PyInt_FromLong(fw_loop(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,__pyx_f_4dnet___fw_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.fw.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_2fw___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1287 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1288 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1289 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_2fw___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_2fw___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1292 */ __pyx_1 = (((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1293 */ fw_close(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.fw.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static int __pyx_f_4dnet_4rand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4rand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1322 */ ((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand = rand_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1323 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1324 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.rand.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_get[] = "Return a string of random bytes.\n \n Arguments:\n len -- number of random bytes to generate\n "; static PyObject *__pyx_f_4dnet_4rand_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_len = 0; char (__pyx_v_buf[1024]); char (*__pyx_v_p); PyObject *__pyx_v_s; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"len",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_len)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_len); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1334 */ __pyx_1 = PyInt_FromLong(1024); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_len, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; goto __pyx_L1;} __pyx_2 = __pyx_2 <= 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1335 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; goto __pyx_L1;} rand_get(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_v_buf,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1336 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} __pyx_1 = PyString_FromStringAndSize(__pyx_v_buf,__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1337 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} __pyx_v_p = malloc(__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1338 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} rand_get(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_v_p,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1339 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} __pyx_1 = PyString_FromStringAndSize(__pyx_v_p,__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1340 */ free(__pyx_v_p); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1341 */ Py_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_len); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_set[] = "Initialize the PRNG from a known seed.\n \n Arguments:\n string -- binary string seed value\n "; static PyObject *__pyx_f_4dnet_4rand_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1349 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;} rand_set(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_1,PyString_Size(__pyx_v_buf)); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_add[] = "Add additional entropy into the PRNG mix.\n\n Arguments:\n string -- binary string\n "; static PyObject *__pyx_f_4dnet_4rand_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1357 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; goto __pyx_L1;} rand_add(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_1,PyString_Size(__pyx_v_buf)); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint8(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint8[] = "Return a random 8-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint8(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1361 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint8(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint8"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint16[] = "Return a random 16-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1365 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint16(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint16"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint32(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint32[] = "Return a random 32-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint32(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1369 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint32(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint32"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_xrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_xrange[] = "xrange([start,] stop) -> xrange object\n\n Return a random permutation iterator to walk an unsigned integer range,\n like xrange().\n "; static PyObject *__pyx_f_4dnet_4rand_xrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"start","stop",0}; __pyx_v_stop = __pyx_k58; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_stop)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_start); Py_INCREF(__pyx_v_stop); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1377 */ if (PyObject_Cmp(__pyx_v_stop, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} __pyx_1 = __pyx_1 == 0; if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1378 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); Py_INCREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_start); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___rand_xrange), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1380 */ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); Py_INCREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_start); Py_INCREF(__pyx_v_stop); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_stop); __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___rand_xrange), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.rand.xrange"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_start); Py_DECREF(__pyx_v_stop); return __pyx_r; } static void __pyx_f_4dnet_4rand___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_4rand___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1383 */ __pyx_1 = (((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1384 */ rand_close(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_k118p; static PyObject *__pyx_k119p; static char (__pyx_k118[]) = "start must be an integer"; static char (__pyx_k119[]) = "stop must be an integer"; static int __pyx_f_4dnet_13__rand_xrange___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_13__rand_xrange___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; unsigned int __pyx_v_bits; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"r","start","stop",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_r, &__pyx_v_start, &__pyx_v_stop)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_r); Py_INCREF(__pyx_v_start); Py_INCREF(__pyx_v_stop); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1402 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->rand = ((struct __pyx_obj_4dnet_rand *)__pyx_v_r)->rand; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1403 */ __pyx_1 = PyInt_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1404 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start = PyInt_AsLong(__pyx_v_start); goto __pyx_L2; } __pyx_1 = PyLong_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1406 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start = PyLong_AsUnsignedLong(__pyx_v_start); goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1408 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k118p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1410 */ __pyx_1 = PyInt_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1411 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max = (PyInt_AsLong(__pyx_v_stop) - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start); goto __pyx_L3; } __pyx_1 = PyLong_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1413 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max = (PyLong_AsUnsignedLong(__pyx_v_stop) - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start); goto __pyx_L3; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1415 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k119p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;} } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1418 */ rand_get(((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->rand,((char (*))((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox),(sizeof(((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1420 */ __pyx_v_bits = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1421 */ while (1) { __pyx_L4:; __pyx_1 = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max > (1 << __pyx_v_bits)); if (!__pyx_1) break; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1422 */ __pyx_v_bits = (__pyx_v_bits + 1); } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1424 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left = (__pyx_v_bits / 2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1425 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->right = (__pyx_v_bits - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1426 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask = ((1 << __pyx_v_bits) - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1428 */ __pyx_1 = (__pyx_e_4dnet_TEASBOXSIZE < (1 << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1429 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask = (__pyx_e_4dnet_TEASBOXSIZE - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1430 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift = __pyx_e_4dnet_TEASBOXSHIFT; goto __pyx_L6; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1432 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask = ((1 << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left) - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1433 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left; } __pyx_L6:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.__rand_xrange.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_r); Py_DECREF(__pyx_v_start); Py_DECREF(__pyx_v_stop); return __pyx_r; } static PyObject *__pyx_f_4dnet_13__rand_xrange___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_13__rand_xrange___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1436 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur = 0; ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1438 */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__rand_xrange.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static Py_ssize_t __pyx_f_4dnet_13__rand_xrange___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_f_4dnet_13__rand_xrange___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1441 */ __pyx_r = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__rand_xrange.__len__"); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_13__rand_xrange___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_13__rand_xrange___next__(PyObject *__pyx_v_self) { unsigned long __pyx_v_c; unsigned long __pyx_v_sum; PyObject *__pyx_v_i; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; long __pyx_3; Py_INCREF(__pyx_v_self); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1446 */ __pyx_1 = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur == ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1447 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1448 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1449 */ while (1) { __pyx_L3:; __pyx_3 = 1; if (!__pyx_3) break; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1450 */ __pyx_v_c = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1451 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1452 */ __pyx_v_sum = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1453 */ for (__pyx_3 = 0+1; __pyx_3 < __pyx_e_4dnet_TEAROUNDS; ++__pyx_3) { __pyx_2 = PyInt_FromLong(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1454 */ __pyx_v_sum = (__pyx_v_sum + __pyx_e_4dnet_TEADELTA); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1455 */ __pyx_v_c = (__pyx_v_c ^ ((((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox[((__pyx_v_c ^ __pyx_v_sum) & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask)]) << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1456 */ __pyx_v_c = (__pyx_v_c + __pyx_v_sum); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1457 */ __pyx_v_c = (__pyx_v_c & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1458 */ __pyx_v_c = (((__pyx_v_c << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left) | (__pyx_v_c >> ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->right)) & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask); __pyx_L5:; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1459 */ __pyx_1 = (__pyx_v_c < ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1460 */ goto __pyx_L4; goto __pyx_L7; } __pyx_L7:; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1461 */ __pyx_2 = PyLong_FromUnsignedLong((((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start + __pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.__rand_xrange.__next__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_3tun___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3tun___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_src = 0; struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; PyObject *__pyx_v_mtu = 0; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"src","dst","mtu",0}; __pyx_v_mtu = __pyx_k59; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_src, &__pyx_v_dst, &__pyx_v_mtu)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_mtu); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_4dnet_addr, 1, "src")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1491 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun = tun_open((&__pyx_v_src->_addr),(&__pyx_v_dst->_addr),__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1492 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->mtu = __pyx_1; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1493 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1494 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1495 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf = malloc(__pyx_1); __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.tun.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_mtu); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_4name___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_4name___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1500 */ __pyx_1 = PyString_FromString(tun_name(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.name.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_2fd___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_2fd___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1505 */ __pyx_1 = PyInt_FromLong(tun_fileno(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.fd.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_fileno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_fileno[] = "Return file descriptor for tunnel handle."; static PyObject *__pyx_f_4dnet_3tun_fileno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1509 */ __pyx_1 = PyInt_FromLong(tun_fileno(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.fileno"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_send[] = "Send an IP packet, returning the number of bytes sent\n or -1 on failure.\n\n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_3tun_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pkt); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1518 */ __pyx_1 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(tun_send(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun,__pyx_1,PyString_Size(__pyx_v_pkt))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.tun.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_recv[] = "Return the next packet delivered to the tunnel interface."; static PyObject *__pyx_f_4dnet_3tun_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1523 */ __pyx_v_n = tun_recv(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun,((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf,((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->mtu); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1524 */ __pyx_1 = (__pyx_v_n < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1525 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1526 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.tun.recv"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1529 */ ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun = tun_close(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.tun.close"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_3tun___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3tun___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1532 */ __pyx_1 = (((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1533 */ free(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf); goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1534 */ __pyx_1 = (((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1535 */ tun_close(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun); goto __pyx_L3; } __pyx_L3:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.tun.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static __Pyx_InternTabEntry __pyx_intern_tab[] = { {&__pyx_n_ADDR_TYPE_ETH, "ADDR_TYPE_ETH"}, {&__pyx_n_ADDR_TYPE_IP, "ADDR_TYPE_IP"}, {&__pyx_n_ADDR_TYPE_IP6, "ADDR_TYPE_IP6"}, {&__pyx_n_ADDR_TYPE_NONE, "ADDR_TYPE_NONE"}, {&__pyx_n_ARP_ETHIP_LEN, "ARP_ETHIP_LEN"}, {&__pyx_n_ARP_HDR_LEN, "ARP_HDR_LEN"}, {&__pyx_n_ARP_HRD_ETH, "ARP_HRD_ETH"}, {&__pyx_n_ARP_HRD_IEEE802, "ARP_HRD_IEEE802"}, {&__pyx_n_ARP_OP_REPLY, "ARP_OP_REPLY"}, {&__pyx_n_ARP_OP_REQUEST, "ARP_OP_REQUEST"}, {&__pyx_n_ARP_OP_REVREPLY, "ARP_OP_REVREPLY"}, {&__pyx_n_ARP_OP_REVREQUEST, "ARP_OP_REVREQUEST"}, {&__pyx_n_ARP_PRO_IP, "ARP_PRO_IP"}, {&__pyx_n_BSD, "BSD"}, {&__pyx_n_ETH_ADDR_BITS, "ETH_ADDR_BITS"}, {&__pyx_n_ETH_ADDR_BROADCAST, "ETH_ADDR_BROADCAST"}, {&__pyx_n_ETH_ADDR_LEN, "ETH_ADDR_LEN"}, {&__pyx_n_ETH_ADDR_UNSPEC, "ETH_ADDR_UNSPEC"}, {&__pyx_n_ETH_CRC_LEN, "ETH_CRC_LEN"}, {&__pyx_n_ETH_HDR_LEN, "ETH_HDR_LEN"}, {&__pyx_n_ETH_LEN_MAX, "ETH_LEN_MAX"}, {&__pyx_n_ETH_LEN_MIN, "ETH_LEN_MIN"}, {&__pyx_n_ETH_MIN, "ETH_MIN"}, {&__pyx_n_ETH_MTU, "ETH_MTU"}, {&__pyx_n_ETH_TYPE_8021Q, "ETH_TYPE_8021Q"}, {&__pyx_n_ETH_TYPE_ARP, "ETH_TYPE_ARP"}, {&__pyx_n_ETH_TYPE_IP, "ETH_TYPE_IP"}, {&__pyx_n_ETH_TYPE_IPV6, "ETH_TYPE_IPV6"}, {&__pyx_n_ETH_TYPE_LEN, "ETH_TYPE_LEN"}, {&__pyx_n_ETH_TYPE_LOOPBACK, "ETH_TYPE_LOOPBACK"}, {&__pyx_n_ETH_TYPE_MPLS, "ETH_TYPE_MPLS"}, {&__pyx_n_ETH_TYPE_MPLS_MCAST, "ETH_TYPE_MPLS_MCAST"}, {&__pyx_n_ETH_TYPE_PPPOE, "ETH_TYPE_PPPOE"}, {&__pyx_n_ETH_TYPE_PPPOEDISC, "ETH_TYPE_PPPOEDISC"}, {&__pyx_n_ETH_TYPE_PUP, "ETH_TYPE_PUP"}, {&__pyx_n_ETH_TYPE_REVARP, "ETH_TYPE_REVARP"}, {&__pyx_n_FW_DIR_IN, "FW_DIR_IN"}, {&__pyx_n_FW_DIR_OUT, "FW_DIR_OUT"}, {&__pyx_n_FW_OP_ALLOW, "FW_OP_ALLOW"}, {&__pyx_n_FW_OP_BLOCK, "FW_OP_BLOCK"}, {&__pyx_n_INTF_FLAG_BROADCAST, "INTF_FLAG_BROADCAST"}, {&__pyx_n_INTF_FLAG_LOOPBACK, "INTF_FLAG_LOOPBACK"}, {&__pyx_n_INTF_FLAG_MULTICAST, "INTF_FLAG_MULTICAST"}, {&__pyx_n_INTF_FLAG_NOARP, "INTF_FLAG_NOARP"}, {&__pyx_n_INTF_FLAG_POINTOPOINT, "INTF_FLAG_POINTOPOINT"}, {&__pyx_n_INTF_FLAG_UP, "INTF_FLAG_UP"}, {&__pyx_n_INTF_TYPE_ETH, "INTF_TYPE_ETH"}, {&__pyx_n_INTF_TYPE_LOOPBACK, "INTF_TYPE_LOOPBACK"}, {&__pyx_n_INTF_TYPE_OTHER, "INTF_TYPE_OTHER"}, {&__pyx_n_INTF_TYPE_TUN, "INTF_TYPE_TUN"}, {&__pyx_n_IP6_ADDR_BITS, "IP6_ADDR_BITS"}, {&__pyx_n_IP6_ADDR_LEN, "IP6_ADDR_LEN"}, {&__pyx_n_IP6_ADDR_LOOPBACK, "IP6_ADDR_LOOPBACK"}, {&__pyx_n_IP6_ADDR_UNSPEC, "IP6_ADDR_UNSPEC"}, {&__pyx_n_IP6_HDR_LEN, "IP6_HDR_LEN"}, {&__pyx_n_IP6_HLIM_DEFAULT, "IP6_HLIM_DEFAULT"}, {&__pyx_n_IP6_HLIM_MAX, "IP6_HLIM_MAX"}, {&__pyx_n_IP6_LEN_MAX, "IP6_LEN_MAX"}, {&__pyx_n_IP6_LEN_MIN, "IP6_LEN_MIN"}, {&__pyx_n_IP6_MTU_MIN, "IP6_MTU_MIN"}, {&__pyx_n_IP_ADDR_ANY, "IP_ADDR_ANY"}, {&__pyx_n_IP_ADDR_BITS, "IP_ADDR_BITS"}, {&__pyx_n_IP_ADDR_BROADCAST, "IP_ADDR_BROADCAST"}, {&__pyx_n_IP_ADDR_LEN, "IP_ADDR_LEN"}, {&__pyx_n_IP_ADDR_LOOPBACK, "IP_ADDR_LOOPBACK"}, {&__pyx_n_IP_ADDR_MCAST_ALL, "IP_ADDR_MCAST_ALL"}, {&__pyx_n_IP_ADDR_MCAST_LOCAL, "IP_ADDR_MCAST_LOCAL"}, {&__pyx_n_IP_DF, "IP_DF"}, {&__pyx_n_IP_HDR_LEN, "IP_HDR_LEN"}, {&__pyx_n_IP_HDR_LEN_MAX, "IP_HDR_LEN_MAX"}, {&__pyx_n_IP_LEN_MAX, "IP_LEN_MAX"}, {&__pyx_n_IP_LEN_MIN, "IP_LEN_MIN"}, {&__pyx_n_IP_MF, "IP_MF"}, {&__pyx_n_IP_OFFMASK, "IP_OFFMASK"}, {&__pyx_n_IP_OPT_LEN, "IP_OPT_LEN"}, {&__pyx_n_IP_OPT_LEN_MAX, "IP_OPT_LEN_MAX"}, {&__pyx_n_IP_PROTO_AH, "IP_PROTO_AH"}, {&__pyx_n_IP_PROTO_ESP, "IP_PROTO_ESP"}, {&__pyx_n_IP_PROTO_GRE, "IP_PROTO_GRE"}, {&__pyx_n_IP_PROTO_ICMP, "IP_PROTO_ICMP"}, {&__pyx_n_IP_PROTO_ICMPV6, "IP_PROTO_ICMPV6"}, {&__pyx_n_IP_PROTO_IGMP, "IP_PROTO_IGMP"}, {&__pyx_n_IP_PROTO_IP, "IP_PROTO_IP"}, {&__pyx_n_IP_PROTO_IPV6, "IP_PROTO_IPV6"}, {&__pyx_n_IP_PROTO_MAX, "IP_PROTO_MAX"}, {&__pyx_n_IP_PROTO_RAW, "IP_PROTO_RAW"}, {&__pyx_n_IP_PROTO_RESERVED, "IP_PROTO_RESERVED"}, {&__pyx_n_IP_PROTO_TCP, "IP_PROTO_TCP"}, {&__pyx_n_IP_PROTO_UDP, "IP_PROTO_UDP"}, {&__pyx_n_IP_RF, "IP_RF"}, {&__pyx_n_IP_TOS_DEFAULT, "IP_TOS_DEFAULT"}, {&__pyx_n_IP_TTL_DEFAULT, "IP_TTL_DEFAULT"}, {&__pyx_n_IP_TTL_MAX, "IP_TTL_MAX"}, {&__pyx_n_NotImplementedError, "NotImplementedError"}, {&__pyx_n_OSError, "OSError"}, {&__pyx_n_OverflowError, "OverflowError"}, {&__pyx_n_StopIteration, "StopIteration"}, {&__pyx_n_TCP_HDR_LEN, "TCP_HDR_LEN"}, {&__pyx_n_TCP_OPT_ALTSUM, "TCP_OPT_ALTSUM"}, {&__pyx_n_TCP_OPT_ALTSUMDATA, "TCP_OPT_ALTSUMDATA"}, {&__pyx_n_TCP_OPT_BUBBA, "TCP_OPT_BUBBA"}, {&__pyx_n_TCP_OPT_CC, "TCP_OPT_CC"}, {&__pyx_n_TCP_OPT_CCECHO, "TCP_OPT_CCECHO"}, {&__pyx_n_TCP_OPT_CCNEW, "TCP_OPT_CCNEW"}, {&__pyx_n_TCP_OPT_CORRUPT, "TCP_OPT_CORRUPT"}, {&__pyx_n_TCP_OPT_ECHO, "TCP_OPT_ECHO"}, {&__pyx_n_TCP_OPT_ECHOREPLY, "TCP_OPT_ECHOREPLY"}, {&__pyx_n_TCP_OPT_EOL, "TCP_OPT_EOL"}, {&__pyx_n_TCP_OPT_MAX, "TCP_OPT_MAX"}, {&__pyx_n_TCP_OPT_MD5, "TCP_OPT_MD5"}, {&__pyx_n_TCP_OPT_MSS, "TCP_OPT_MSS"}, {&__pyx_n_TCP_OPT_NOP, "TCP_OPT_NOP"}, {&__pyx_n_TCP_OPT_POCONN, "TCP_OPT_POCONN"}, {&__pyx_n_TCP_OPT_POSVC, "TCP_OPT_POSVC"}, {&__pyx_n_TCP_OPT_REC, "TCP_OPT_REC"}, {&__pyx_n_TCP_OPT_SACK, "TCP_OPT_SACK"}, {&__pyx_n_TCP_OPT_SACKOK, "TCP_OPT_SACKOK"}, {&__pyx_n_TCP_OPT_SCPS, "TCP_OPT_SCPS"}, {&__pyx_n_TCP_OPT_SKEETER, "TCP_OPT_SKEETER"}, {&__pyx_n_TCP_OPT_SNACK, "TCP_OPT_SNACK"}, {&__pyx_n_TCP_OPT_SNAP, "TCP_OPT_SNAP"}, {&__pyx_n_TCP_OPT_TCPCOMP, "TCP_OPT_TCPCOMP"}, {&__pyx_n_TCP_OPT_TIMESTAMP, "TCP_OPT_TIMESTAMP"}, {&__pyx_n_TCP_OPT_TRAILSUM, "TCP_OPT_TRAILSUM"}, {&__pyx_n_TCP_OPT_WSCALE, "TCP_OPT_WSCALE"}, {&__pyx_n_TCP_PORT_MAX, "TCP_PORT_MAX"}, {&__pyx_n_TCP_WIN_MAX, "TCP_WIN_MAX"}, {&__pyx_n_TH_ACK, "TH_ACK"}, {&__pyx_n_TH_CWR, "TH_CWR"}, {&__pyx_n_TH_ECE, "TH_ECE"}, {&__pyx_n_TH_FIN, "TH_FIN"}, {&__pyx_n_TH_PUSH, "TH_PUSH"}, {&__pyx_n_TH_RST, "TH_RST"}, {&__pyx_n_TH_SYN, "TH_SYN"}, {&__pyx_n_TH_URG, "TH_URG"}, {&__pyx_n_TypeError, "TypeError"}, {&__pyx_n_UDP_HDR_LEN, "UDP_HDR_LEN"}, {&__pyx_n_UDP_PORT_MAX, "UDP_PORT_MAX"}, {&__pyx_n_ValueError, "ValueError"}, {&__pyx_n___author__, "__author__"}, {&__pyx_n___copy__, "__copy__"}, {&__pyx_n___copyright__, "__copyright__"}, {&__pyx_n___int__, "__int__"}, {&__pyx_n___iter_append, "__iter_append"}, {&__pyx_n___license__, "__license__"}, {&__pyx_n___url__, "__url__"}, {&__pyx_n___version__, "__version__"}, {&__pyx_n_addr, "addr"}, {&__pyx_n_alias_addrs, "alias_addrs"}, {&__pyx_n_append, "append"}, {&__pyx_n_arp_pack_hdr_ethip, "arp_pack_hdr_ethip"}, {&__pyx_n_device, "device"}, {&__pyx_n_dir, "dir"}, {&__pyx_n_dport, "dport"}, {&__pyx_n_dst, "dst"}, {&__pyx_n_dst_addr, "dst_addr"}, {&__pyx_n_eth, "eth"}, {&__pyx_n_eth_aton, "eth_aton"}, {&__pyx_n_eth_ntoa, "eth_ntoa"}, {&__pyx_n_eth_pack_hdr, "eth_pack_hdr"}, {&__pyx_n_flags, "flags"}, {&__pyx_n_icmp_pack_hdr, "icmp_pack_hdr"}, {&__pyx_n_ip, "ip"}, {&__pyx_n_ip6, "ip6"}, {&__pyx_n_ip6_aton, "ip6_aton"}, {&__pyx_n_ip6_checksum, "ip6_checksum"}, {&__pyx_n_ip6_ntoa, "ip6_ntoa"}, {&__pyx_n_ip6_pack_hdr, "ip6_pack_hdr"}, {&__pyx_n_ip_aton, "ip_aton"}, {&__pyx_n_ip_checksum, "ip_checksum"}, {&__pyx_n_ip_cksum_add, "ip_cksum_add"}, {&__pyx_n_ip_cksum_carry, "ip_cksum_carry"}, {&__pyx_n_ip_ntoa, "ip_ntoa"}, {&__pyx_n_ip_pack_hdr, "ip_pack_hdr"}, {&__pyx_n_iter, "iter"}, {&__pyx_n_len, "len"}, {&__pyx_n_link_addr, "link_addr"}, {&__pyx_n_loop, "loop"}, {&__pyx_n_mtu, "mtu"}, {&__pyx_n_name, "name"}, {&__pyx_n_op, "op"}, {&__pyx_n_proto, "proto"}, {&__pyx_n_sport, "sport"}, {&__pyx_n_src, "src"}, {&__pyx_n_tcp_pack_hdr, "tcp_pack_hdr"}, {&__pyx_n_type, "type"}, {&__pyx_n_udp_pack_hdr, "udp_pack_hdr"}, {0, 0} }; static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)}, {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)}, {&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)}, {&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13)}, {&__pyx_k60p, __pyx_k60, sizeof(__pyx_k60)}, {&__pyx_k61p, __pyx_k61, sizeof(__pyx_k61)}, {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)}, {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)}, {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)}, {&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)}, {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)}, {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)}, {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)}, {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)}, {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)}, {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)}, {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)}, {&__pyx_k118p, __pyx_k118, sizeof(__pyx_k118)}, {&__pyx_k119p, __pyx_k119, sizeof(__pyx_k119)}, {0, 0, 0} }; static PyObject *__pyx_tp_new_4dnet_eth(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return o; } static void __pyx_tp_dealloc_4dnet_eth(PyObject *o) { struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3eth___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_eth(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return 0; } static int __pyx_tp_clear_4dnet_eth(PyObject *o) { struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_eth[] = { {"get", (PyCFunction)__pyx_f_4dnet_3eth_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_get}, {"set", (PyCFunction)__pyx_f_4dnet_3eth_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_set}, {"send", (PyCFunction)__pyx_f_4dnet_3eth_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_send}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_eth = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_eth = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_eth = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_eth = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_eth = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.eth", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_eth), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_eth, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_eth, /*tp_as_number*/ &__pyx_tp_as_sequence_eth, /*tp_as_sequence*/ &__pyx_tp_as_mapping_eth, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_eth, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "eth(device) -> Ethernet device object\n\n Open the specified Ethernet device for sending.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_eth, /*tp_traverse*/ __pyx_tp_clear_4dnet_eth, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_eth, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3eth___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_eth, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_ip(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return o; } static void __pyx_tp_dealloc_4dnet_ip(PyObject *o) { struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_2ip___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_ip(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return 0; } static int __pyx_tp_clear_4dnet_ip(PyObject *o) { struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_ip[] = { {"send", (PyCFunction)__pyx_f_4dnet_2ip_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2ip_send}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_ip = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_ip = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_ip = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_ip = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_ip = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.ip", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_ip), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_ip, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_ip, /*tp_as_number*/ &__pyx_tp_as_sequence_ip, /*tp_as_sequence*/ &__pyx_tp_as_mapping_ip, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ip, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "ip() -> Raw IP object\n\n Open a raw IP socket for sending.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_ip, /*tp_traverse*/ __pyx_tp_clear_4dnet_ip, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_ip, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_2ip___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_ip, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_addr(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return o; } static void __pyx_tp_dealloc_4dnet_addr(PyObject *o) { struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_addr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return 0; } static int __pyx_tp_clear_4dnet_addr(PyObject *o) { struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return 0; } static PyObject *__pyx_getprop_4dnet_4addr_type(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4type___get__(o); } static int __pyx_setprop_4dnet_4addr_type(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_4type___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_bits(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4bits___get__(o); } static int __pyx_setprop_4dnet_4addr_bits(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_4bits___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_data(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4data___get__(o); } static PyObject *__pyx_getprop_4dnet_4addr_eth(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_3eth___get__(o); } static int __pyx_setprop_4dnet_4addr_eth(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_3eth___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_ip(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_2ip___get__(o); } static int __pyx_setprop_4dnet_4addr_ip(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_2ip___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_ip6(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_3ip6___get__(o); } static int __pyx_setprop_4dnet_4addr_ip6(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_3ip6___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static struct PyMethodDef __pyx_methods_4dnet_addr[] = { {"bcast", (PyCFunction)__pyx_f_4dnet_4addr_bcast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4addr_bcast}, {"net", (PyCFunction)__pyx_f_4dnet_4addr_net, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4addr_net}, {"__copy__", (PyCFunction)__pyx_f_4dnet_4addr___copy__, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_4dnet_addr[] = { {"type", __pyx_getprop_4dnet_4addr_type, __pyx_setprop_4dnet_4addr_type, __pyx_k1, 0}, {"bits", __pyx_getprop_4dnet_4addr_bits, __pyx_setprop_4dnet_4addr_bits, __pyx_k2, 0}, {"data", __pyx_getprop_4dnet_4addr_data, 0, __pyx_k3, 0}, {"eth", __pyx_getprop_4dnet_4addr_eth, __pyx_setprop_4dnet_4addr_eth, __pyx_k4, 0}, {"ip", __pyx_getprop_4dnet_4addr_ip, __pyx_setprop_4dnet_4addr_ip, __pyx_k5, 0}, {"ip6", __pyx_getprop_4dnet_4addr_ip6, __pyx_setprop_4dnet_4addr_ip6, __pyx_k6, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_addr = { __pyx_f_4dnet_4addr___add__, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ __pyx_f_4dnet_4addr___int__, /*nb_int*/ __pyx_f_4dnet_4addr___long__, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_addr = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_f_4dnet_4addr___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_addr = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_addr = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_addr = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.addr", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_addr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_addr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ __pyx_f_4dnet_4addr___cmp__, /*tp_compare*/ __pyx_f_4dnet_4addr___repr__, /*tp_repr*/ &__pyx_tp_as_number_addr, /*tp_as_number*/ &__pyx_tp_as_sequence_addr, /*tp_as_sequence*/ &__pyx_tp_as_mapping_addr, /*tp_as_mapping*/ __pyx_f_4dnet_4addr___hash__, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_addr, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "addr(addrtxt=None, type=ADDR_TYPE_NONE) -> network address object\n\n Create a network address object, optionally initialized from a\n human-readable Ethernet, IP, or IPv6 address string.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_addr, /*tp_traverse*/ __pyx_tp_clear_4dnet_addr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_4addr___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_addr, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_4dnet_addr, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4addr___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_addr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet___addr_ip4_iter(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return o; } static void __pyx_tp_dealloc_4dnet___addr_ip4_iter(PyObject *o) { struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet___addr_ip4_iter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return 0; } static int __pyx_tp_clear_4dnet___addr_ip4_iter(PyObject *o) { struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet___addr_ip4_iter[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number___addr_ip4_iter = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence___addr_ip4_iter = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping___addr_ip4_iter = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer___addr_ip4_iter = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet___addr_ip4_iter = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.__addr_ip4_iter", /*tp_name*/ sizeof(struct __pyx_obj_4dnet___addr_ip4_iter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet___addr_ip4_iter, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number___addr_ip4_iter, /*tp_as_number*/ &__pyx_tp_as_sequence___addr_ip4_iter, /*tp_as_sequence*/ &__pyx_tp_as_mapping___addr_ip4_iter, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer___addr_ip4_iter, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4dnet___addr_ip4_iter, /*tp_traverse*/ __pyx_tp_clear_4dnet___addr_ip4_iter, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ __pyx_f_4dnet_15__addr_ip4_iter___next__, /*tp_iternext*/ __pyx_methods_4dnet___addr_ip4_iter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_15__addr_ip4_iter___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet___addr_ip4_iter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_arp(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return o; } static void __pyx_tp_dealloc_4dnet_arp(PyObject *o) { struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3arp___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_arp(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return 0; } static int __pyx_tp_clear_4dnet_arp(PyObject *o) { struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_arp[] = { {"add", (PyCFunction)__pyx_f_4dnet_3arp_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_add}, {"delete", (PyCFunction)__pyx_f_4dnet_3arp_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_delete}, {"get", (PyCFunction)__pyx_f_4dnet_3arp_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_get}, {"loop", (PyCFunction)__pyx_f_4dnet_3arp_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_arp = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_arp = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_arp = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_arp = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_arp = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.arp", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_arp), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_arp, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_arp, /*tp_as_number*/ &__pyx_tp_as_sequence_arp, /*tp_as_sequence*/ &__pyx_tp_as_mapping_arp, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_arp, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "arp() -> ARP table object\n\n Open a handle to the system ARP table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_arp, /*tp_traverse*/ __pyx_tp_clear_4dnet_arp, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_3arp___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_arp, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3arp___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_arp, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_intf(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return o; } static void __pyx_tp_dealloc_4dnet_intf(PyObject *o) { struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_4intf___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_intf(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return 0; } static int __pyx_tp_clear_4dnet_intf(PyObject *o) { struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_intf[] = { {"get", (PyCFunction)__pyx_f_4dnet_4intf_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get}, {"get_src", (PyCFunction)__pyx_f_4dnet_4intf_get_src, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get_src}, {"get_dst", (PyCFunction)__pyx_f_4dnet_4intf_get_dst, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get_dst}, {"set", (PyCFunction)__pyx_f_4dnet_4intf_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_set}, {"loop", (PyCFunction)__pyx_f_4dnet_4intf_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_intf = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_intf = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_intf = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_intf = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_intf = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.intf", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_intf), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_intf, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_intf, /*tp_as_number*/ &__pyx_tp_as_sequence_intf, /*tp_as_sequence*/ &__pyx_tp_as_mapping_intf, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_intf, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "intf() -> Interface table object\n\n Open a handle to the system network interface table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_intf, /*tp_traverse*/ __pyx_tp_clear_4dnet_intf, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_4intf___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_intf, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4intf___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_intf, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_route(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return o; } static void __pyx_tp_dealloc_4dnet_route(PyObject *o) { struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_5route___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_route(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return 0; } static int __pyx_tp_clear_4dnet_route(PyObject *o) { struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_route[] = { {"add", (PyCFunction)__pyx_f_4dnet_5route_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_add}, {"delete", (PyCFunction)__pyx_f_4dnet_5route_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_delete}, {"get", (PyCFunction)__pyx_f_4dnet_5route_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_get}, {"loop", (PyCFunction)__pyx_f_4dnet_5route_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_route = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_route = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_route = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_route = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_route = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.route", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_route), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_route, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_route, /*tp_as_number*/ &__pyx_tp_as_sequence_route, /*tp_as_sequence*/ &__pyx_tp_as_mapping_route, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_route, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "route() -> Routing table object\n\n Open a handle to the system routing table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_route, /*tp_traverse*/ __pyx_tp_clear_4dnet_route, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_5route___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_route, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_5route___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_route, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_fw(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return o; } static void __pyx_tp_dealloc_4dnet_fw(PyObject *o) { struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_2fw___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_fw(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return 0; } static int __pyx_tp_clear_4dnet_fw(PyObject *o) { struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_fw[] = { {"add", (PyCFunction)__pyx_f_4dnet_2fw_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_add}, {"delete", (PyCFunction)__pyx_f_4dnet_2fw_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_delete}, {"loop", (PyCFunction)__pyx_f_4dnet_2fw_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_fw = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_fw = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_fw = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_fw = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_fw = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.fw", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_fw), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_fw, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_fw, /*tp_as_number*/ &__pyx_tp_as_sequence_fw, /*tp_as_sequence*/ &__pyx_tp_as_mapping_fw, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_fw, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "fw() -> Firewall ruleset object\n \n Open a handle to the local network firewall configuration.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_fw, /*tp_traverse*/ __pyx_tp_clear_4dnet_fw, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_2fw___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_fw, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_2fw___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_fw, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_rand(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return o; } static void __pyx_tp_dealloc_4dnet_rand(PyObject *o) { struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_4rand___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_rand(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return 0; } static int __pyx_tp_clear_4dnet_rand(PyObject *o) { struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_rand[] = { {"get", (PyCFunction)__pyx_f_4dnet_4rand_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_get}, {"set", (PyCFunction)__pyx_f_4dnet_4rand_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_set}, {"add", (PyCFunction)__pyx_f_4dnet_4rand_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_add}, {"uint8", (PyCFunction)__pyx_f_4dnet_4rand_uint8, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint8}, {"uint16", (PyCFunction)__pyx_f_4dnet_4rand_uint16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint16}, {"uint32", (PyCFunction)__pyx_f_4dnet_4rand_uint32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint32}, {"xrange", (PyCFunction)__pyx_f_4dnet_4rand_xrange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_xrange}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_rand = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_rand = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_rand = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_rand = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_rand = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.rand", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_rand), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_rand, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_rand, /*tp_as_number*/ &__pyx_tp_as_sequence_rand, /*tp_as_sequence*/ &__pyx_tp_as_mapping_rand, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_rand, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "rand() -> Pseudo-random number generator\n\n Obtain a handle for fast, cryptographically strong pseudo-random\n number generation. The starting seed is derived from the system\n random data source device (if one exists), or from the current time\n and random stack contents.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_rand, /*tp_traverse*/ __pyx_tp_clear_4dnet_rand, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_rand, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4rand___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_rand, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet___rand_xrange(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return o; } static void __pyx_tp_dealloc_4dnet___rand_xrange(PyObject *o) { struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet___rand_xrange(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return 0; } static int __pyx_tp_clear_4dnet___rand_xrange(PyObject *o) { struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet___rand_xrange[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number___rand_xrange = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence___rand_xrange = { __pyx_f_4dnet_13__rand_xrange___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping___rand_xrange = { __pyx_f_4dnet_13__rand_xrange___len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer___rand_xrange = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet___rand_xrange = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.__rand_xrange", /*tp_name*/ sizeof(struct __pyx_obj_4dnet___rand_xrange), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet___rand_xrange, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number___rand_xrange, /*tp_as_number*/ &__pyx_tp_as_sequence___rand_xrange, /*tp_as_sequence*/ &__pyx_tp_as_mapping___rand_xrange, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer___rand_xrange, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4dnet___rand_xrange, /*tp_traverse*/ __pyx_tp_clear_4dnet___rand_xrange, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_13__rand_xrange___iter__, /*tp_iter*/ __pyx_f_4dnet_13__rand_xrange___next__, /*tp_iternext*/ __pyx_methods_4dnet___rand_xrange, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_13__rand_xrange___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet___rand_xrange, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_tun(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return o; } static void __pyx_tp_dealloc_4dnet_tun(PyObject *o) { struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3tun___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_tun(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return 0; } static int __pyx_tp_clear_4dnet_tun(PyObject *o) { struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return 0; } static PyObject *__pyx_getprop_4dnet_3tun_name(PyObject *o, void *x) { return __pyx_f_4dnet_3tun_4name___get__(o); } static PyObject *__pyx_getprop_4dnet_3tun_fd(PyObject *o, void *x) { return __pyx_f_4dnet_3tun_2fd___get__(o); } static struct PyMethodDef __pyx_methods_4dnet_tun[] = { {"fileno", (PyCFunction)__pyx_f_4dnet_3tun_fileno, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_fileno}, {"send", (PyCFunction)__pyx_f_4dnet_3tun_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_send}, {"recv", (PyCFunction)__pyx_f_4dnet_3tun_recv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_recv}, {"close", (PyCFunction)__pyx_f_4dnet_3tun_close, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_4dnet_tun[] = { {"name", __pyx_getprop_4dnet_3tun_name, 0, __pyx_k7, 0}, {"fd", __pyx_getprop_4dnet_3tun_fd, 0, __pyx_k8, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_tun = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_tun = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_tun = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_tun = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_tun = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.tun", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_tun), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_tun, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_tun, /*tp_as_number*/ &__pyx_tp_as_sequence_tun, /*tp_as_sequence*/ &__pyx_tp_as_mapping_tun, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_tun, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "tun(src, dst[, mtu]) -> Network tunnel interface handle\n \n Obtain a handle to a network tunnel interface, to which packets\n destined for dst are delivered (with source addresses rewritten to\n src), where they may be read by a userland process and processed\n as desired. Packets written back to the handle are injected into\n the kernel networking subsystem.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_tun, /*tp_traverse*/ __pyx_tp_clear_4dnet_tun, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_tun, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_4dnet_tun, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3tun___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_tun, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static struct PyMethodDef __pyx_methods[] = { {"__iter_append", (PyCFunction)__pyx_f_4dnet___iter_append, METH_VARARGS|METH_KEYWORDS, 0}, {"eth_ntoa", (PyCFunction)__pyx_f_4dnet_eth_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_ntoa}, {"eth_aton", (PyCFunction)__pyx_f_4dnet_eth_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_aton}, {"eth_pack_hdr", (PyCFunction)__pyx_f_4dnet_eth_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_pack_hdr}, {"ip_ntoa", (PyCFunction)__pyx_f_4dnet_ip_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_ntoa}, {"ip_aton", (PyCFunction)__pyx_f_4dnet_ip_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_aton}, {"ip_checksum", (PyCFunction)__pyx_f_4dnet_ip_checksum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_checksum}, {"ip_cksum_add", (PyCFunction)__pyx_f_4dnet_ip_cksum_add, METH_VARARGS|METH_KEYWORDS, 0}, {"ip_cksum_carry", (PyCFunction)__pyx_f_4dnet_ip_cksum_carry, METH_VARARGS|METH_KEYWORDS, 0}, {"ip_pack_hdr", (PyCFunction)__pyx_f_4dnet_ip_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_pack_hdr}, {"ip6_ntoa", (PyCFunction)__pyx_f_4dnet_ip6_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_ntoa}, {"ip6_aton", (PyCFunction)__pyx_f_4dnet_ip6_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_aton}, {"ip6_checksum", (PyCFunction)__pyx_f_4dnet_ip6_checksum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_checksum}, {"ip6_pack_hdr", (PyCFunction)__pyx_f_4dnet_ip6_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_pack_hdr}, {"arp_pack_hdr_ethip", (PyCFunction)__pyx_f_4dnet_arp_pack_hdr_ethip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_arp_pack_hdr_ethip}, {"icmp_pack_hdr", (PyCFunction)__pyx_f_4dnet_icmp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_icmp_pack_hdr}, {"tcp_pack_hdr", (PyCFunction)__pyx_f_4dnet_tcp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_tcp_pack_hdr}, {"udp_pack_hdr", (PyCFunction)__pyx_f_4dnet_udp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_udp_pack_hdr}, {0, 0, 0, 0} }; static void __pyx_init_filenames(void); /*proto*/ PyMODINIT_FUNC initdnet(void); /*proto*/ PyMODINIT_FUNC initdnet(void) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; PyObject *__pyx_7 = 0; PyObject *__pyx_8 = 0; PyObject *__pyx_9 = 0; PyObject *__pyx_10 = 0; PyObject *__pyx_11 = 0; PyObject *__pyx_12 = 0; PyObject *__pyx_13 = 0; PyObject *__pyx_14 = 0; PyObject *__pyx_15 = 0; PyObject *__pyx_16 = 0; PyObject *__pyx_17 = 0; PyObject *__pyx_18 = 0; PyObject *__pyx_19 = 0; PyObject *__pyx_20 = 0; PyObject *__pyx_21 = 0; PyObject *__pyx_22 = 0; PyObject *__pyx_23 = 0; PyObject *__pyx_24 = 0; PyObject *__pyx_25 = 0; PyObject *__pyx_26 = 0; PyObject *__pyx_27 = 0; PyObject *__pyx_28 = 0; PyObject *__pyx_29 = 0; PyObject *__pyx_30 = 0; PyObject *__pyx_31 = 0; __pyx_init_filenames(); __pyx_m = Py_InitModule4("dnet", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (PyType_Ready(&__pyx_type_4dnet_eth) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "eth", (PyObject *)&__pyx_type_4dnet_eth) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} __pyx_ptype_4dnet_eth = &__pyx_type_4dnet_eth; if (PyType_Ready(&__pyx_type_4dnet_ip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "ip", (PyObject *)&__pyx_type_4dnet_ip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} __pyx_ptype_4dnet_ip = &__pyx_type_4dnet_ip; if (PyType_Ready(&__pyx_type_4dnet_addr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "addr", (PyObject *)&__pyx_type_4dnet_addr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} __pyx_ptype_4dnet_addr = &__pyx_type_4dnet_addr; if (PyType_Ready(&__pyx_type_4dnet___addr_ip4_iter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "__addr_ip4_iter", (PyObject *)&__pyx_type_4dnet___addr_ip4_iter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;} __pyx_ptype_4dnet___addr_ip4_iter = &__pyx_type_4dnet___addr_ip4_iter; if (PyType_Ready(&__pyx_type_4dnet_arp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "arp", (PyObject *)&__pyx_type_4dnet_arp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} __pyx_ptype_4dnet_arp = &__pyx_type_4dnet_arp; if (PyType_Ready(&__pyx_type_4dnet_intf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "intf", (PyObject *)&__pyx_type_4dnet_intf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} __pyx_ptype_4dnet_intf = &__pyx_type_4dnet_intf; if (PyType_Ready(&__pyx_type_4dnet_route) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "route", (PyObject *)&__pyx_type_4dnet_route) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} __pyx_ptype_4dnet_route = &__pyx_type_4dnet_route; if (PyType_Ready(&__pyx_type_4dnet_fw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "fw", (PyObject *)&__pyx_type_4dnet_fw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} __pyx_ptype_4dnet_fw = &__pyx_type_4dnet_fw; if (PyType_Ready(&__pyx_type_4dnet_rand) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "rand", (PyObject *)&__pyx_type_4dnet_rand) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} __pyx_ptype_4dnet_rand = &__pyx_type_4dnet_rand; if (PyType_Ready(&__pyx_type_4dnet___rand_xrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "__rand_xrange", (PyObject *)&__pyx_type_4dnet___rand_xrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} __pyx_ptype_4dnet___rand_xrange = &__pyx_type_4dnet___rand_xrange; if (PyType_Ready(&__pyx_type_4dnet_tun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "tun", (PyObject *)&__pyx_type_4dnet_tun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} __pyx_ptype_4dnet_tun = &__pyx_type_4dnet_tun; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":15 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_k9p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":16 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_k10p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":17 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_n_BSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":18 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k12p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":19 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k13p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":75 */ __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":76 */ __pyx_1 = PyInt_FromLong(48); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_BITS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":77 */ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":78 */ __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_CRC_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":79 */ __pyx_1 = PyInt_FromLong(14); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_HDR_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":81 */ __pyx_1 = PyInt_FromLong(64); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_LEN_MIN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":82 */ __pyx_1 = PyInt_FromLong(1518); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_LEN_MAX, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":84 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_LEN_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_HDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_CRC_LEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_MTU, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":85 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_LEN_MIN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_HDR_LEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_CRC_LEN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_1 = PyNumber_Subtract(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_MIN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":87 */ __pyx_2 = PyInt_FromLong(512); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PUP, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":88 */ __pyx_3 = PyInt_FromLong(2048); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_IP, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":89 */ __pyx_1 = PyInt_FromLong(2054); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_ARP, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":90 */ __pyx_2 = PyInt_FromLong(32821); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_REVARP, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":91 */ __pyx_3 = PyInt_FromLong(33024); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_8021Q, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":92 */ __pyx_1 = PyInt_FromLong(34525); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_IPV6, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":93 */ __pyx_2 = PyInt_FromLong(34887); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_MPLS, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":94 */ __pyx_3 = PyInt_FromLong(34888); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_MPLS_MCAST, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":95 */ __pyx_1 = PyInt_FromLong(34915); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PPPOEDISC, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":96 */ __pyx_2 = PyInt_FromLong(34916); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PPPOE, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":97 */ __pyx_3 = PyInt_FromLong(36864); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_LOOPBACK, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":99 */ __pyx_1 = PyString_FromStringAndSize(__pyx_k14,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":100 */ __pyx_2 = PyString_FromStringAndSize(__pyx_k15,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":162 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} __pyx_k16 = __pyx_3; __pyx_3 = 0; __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} __pyx_k17 = __pyx_1; __pyx_1 = 0; __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;} __pyx_k18 = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":199 */ __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":200 */ __pyx_4 = PyInt_FromLong(32); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_BITS, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":202 */ __pyx_4 = PyInt_FromLong(20); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_HDR_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":203 */ __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OPT_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":204 */ __pyx_4 = PyInt_FromLong(40); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OPT_LEN_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":205 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_OPT_LEN_MAX); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} __pyx_6 = PyNumber_Add(__pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_HDR_LEN_MAX, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":207 */ __pyx_4 = PyInt_FromLong(65535); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_LEN_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":208 */ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_LEN_MIN, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":210 */ __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TOS_DEFAULT, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":212 */ __pyx_4 = PyInt_FromLong(32768); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_RF, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":213 */ __pyx_5 = PyInt_FromLong(16384); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_DF, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":214 */ __pyx_6 = PyInt_FromLong(8192); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_MF, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":215 */ __pyx_4 = PyInt_FromLong(8191); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OFFMASK, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":217 */ __pyx_5 = PyInt_FromLong(64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TTL_DEFAULT, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":218 */ __pyx_6 = PyInt_FromLong(255); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TTL_MAX, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":220 */ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IP, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":221 */ __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ICMP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":222 */ __pyx_6 = PyInt_FromLong(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IGMP, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":223 */ __pyx_4 = PyInt_FromLong(6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_TCP, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":224 */ __pyx_5 = PyInt_FromLong(17); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_UDP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":225 */ __pyx_6 = PyInt_FromLong(41); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IPV6, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":226 */ __pyx_4 = PyInt_FromLong(47); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_GRE, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":227 */ __pyx_5 = PyInt_FromLong(50); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ESP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":228 */ __pyx_6 = PyInt_FromLong(51); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_AH, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":229 */ __pyx_4 = PyInt_FromLong(58); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ICMPV6, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":230 */ __pyx_5 = PyInt_FromLong(255); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_RAW, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":231 */ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_RAW); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_RESERVED, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":232 */ __pyx_4 = PyInt_FromLong(255); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":234 */ __pyx_5 = PyString_FromStringAndSize(__pyx_k19,4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_ANY, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":235 */ __pyx_6 = PyString_FromStringAndSize(__pyx_k20,4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_BROADCAST, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":236 */ __pyx_4 = PyString_FromStringAndSize(__pyx_k21,4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_LOOPBACK, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":237 */ __pyx_5 = PyString_FromStringAndSize(__pyx_k22,4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_MCAST_ALL, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":238 */ __pyx_6 = PyString_FromStringAndSize(__pyx_k23,4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_MCAST_LOCAL, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":320 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_TOS_DEFAULT); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k24 = __pyx_4; __pyx_4 = 0; __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k25 = __pyx_5; __pyx_5 = 0; __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k26 = __pyx_6; __pyx_6 = 0; __pyx_7 = PyInt_FromLong(0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k27 = __pyx_7; __pyx_7 = 0; __pyx_8 = __Pyx_GetName(__pyx_m, __pyx_n_IP_TTL_DEFAULT); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} __pyx_k28 = __pyx_8; __pyx_8 = 0; __pyx_9 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_IP); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} __pyx_k29 = __pyx_9; __pyx_9 = 0; __pyx_10 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_k30 = __pyx_10; __pyx_10 = 0; __pyx_11 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_k31 = __pyx_11; __pyx_11 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":355 */ __pyx_12 = PyInt_FromLong(16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_LEN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":356 */ __pyx_12 = PyInt_FromLong(128); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_BITS, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":358 */ __pyx_12 = PyInt_FromLong(40); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HDR_LEN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":359 */ __pyx_12 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_HDR_LEN); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_LEN_MIN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":360 */ __pyx_12 = PyInt_FromLong(65535); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_LEN_MAX, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":362 */ __pyx_12 = PyInt_FromLong(1280); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_MTU_MIN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":364 */ __pyx_12 = PyInt_FromLong(64); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HLIM_DEFAULT, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":365 */ __pyx_12 = PyInt_FromLong(255); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HLIM_MAX, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":367 */ __pyx_12 = PyString_FromStringAndSize(__pyx_k32,16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":368 */ __pyx_12 = PyString_FromStringAndSize(__pyx_k33,16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_LOOPBACK, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":395 */ __pyx_12 = PyInt_FromLong(0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k34 = __pyx_12; __pyx_12 = 0; __pyx_13 = PyInt_FromLong(0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k35 = __pyx_13; __pyx_13 = 0; __pyx_14 = PyInt_FromLong(0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k36 = __pyx_14; __pyx_14 = 0; __pyx_15 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_IPV6); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k37 = __pyx_15; __pyx_15 = 0; __pyx_16 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_HLIM_DEFAULT); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k38 = __pyx_16; __pyx_16 = 0; __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} __pyx_k39 = __pyx_17; __pyx_17 = 0; __pyx_18 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} __pyx_k40 = __pyx_18; __pyx_18 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":431 */ __pyx_19 = PyInt_FromLong(0); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_NONE, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":432 */ __pyx_19 = PyInt_FromLong(1); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_ETH, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":433 */ __pyx_19 = PyInt_FromLong(2); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_IP, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":434 */ __pyx_19 = PyInt_FromLong(3); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_IP6, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":444 */ Py_INCREF(Py_None); __pyx_k41 = Py_None; __pyx_19 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} __pyx_k42 = __pyx_19; __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":666 */ __pyx_20 = PyInt_FromLong(8); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HDR_LEN, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":667 */ __pyx_20 = PyInt_FromLong(20); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_ETHIP_LEN, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":669 */ __pyx_20 = PyInt_FromLong(1); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HRD_ETH, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":670 */ __pyx_20 = PyInt_FromLong(6); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HRD_IEEE802, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":672 */ __pyx_20 = PyInt_FromLong(2048); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_PRO_IP, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":674 */ __pyx_20 = PyInt_FromLong(1); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REQUEST, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":675 */ __pyx_20 = PyInt_FromLong(2); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REPLY, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":676 */ __pyx_20 = PyInt_FromLong(3); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REVREQUEST, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":677 */ __pyx_20 = PyInt_FromLong(4); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REVREPLY, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":738 */ Py_INCREF(Py_None); __pyx_k43 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":760 */ __pyx_20 = __Pyx_GetName(__pyx_m, __pyx_n_ARP_OP_REQUEST); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} __pyx_k44 = __pyx_20; __pyx_20 = 0; __pyx_21 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC); if (!__pyx_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} __pyx_k45 = __pyx_21; __pyx_21 = 0; __pyx_22 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_22) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} __pyx_k46 = __pyx_22; __pyx_22 = 0; __pyx_23 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC); if (!__pyx_23) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} __pyx_k47 = __pyx_23; __pyx_23 = 0; __pyx_24 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} __pyx_k48 = __pyx_24; __pyx_24 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":806 */ __pyx_25 = PyInt_FromLong(20); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_HDR_LEN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":808 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_FIN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":809 */ __pyx_25 = PyInt_FromLong(2); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_SYN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":810 */ __pyx_25 = PyInt_FromLong(4); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_RST, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":811 */ __pyx_25 = PyInt_FromLong(8); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_PUSH, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":812 */ __pyx_25 = PyInt_FromLong(16); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_ACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":813 */ __pyx_25 = PyInt_FromLong(32); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_URG, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":814 */ __pyx_25 = PyInt_FromLong(64); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_ECE, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":815 */ __pyx_25 = PyInt_FromLong(128); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_CWR, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":817 */ __pyx_25 = PyInt_FromLong(65535); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_PORT_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":818 */ __pyx_25 = PyInt_FromLong(65535); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_WIN_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":820 */ __pyx_25 = PyInt_FromLong(0); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_EOL, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":821 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_NOP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":822 */ __pyx_25 = PyInt_FromLong(2); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MSS, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":823 */ __pyx_25 = PyInt_FromLong(3); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_WSCALE, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":824 */ __pyx_25 = PyInt_FromLong(4); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SACKOK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":825 */ __pyx_25 = PyInt_FromLong(5); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":826 */ __pyx_25 = PyInt_FromLong(6); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ECHO, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":827 */ __pyx_25 = PyInt_FromLong(7); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ECHOREPLY, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":828 */ __pyx_25 = PyInt_FromLong(8); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TIMESTAMP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":829 */ __pyx_25 = PyInt_FromLong(9); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_POCONN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":830 */ __pyx_25 = PyInt_FromLong(10); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_POSVC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":831 */ __pyx_25 = PyInt_FromLong(11); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":832 */ __pyx_25 = PyInt_FromLong(12); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CCNEW, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":833 */ __pyx_25 = PyInt_FromLong(13); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CCECHO, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":834 */ __pyx_25 = PyInt_FromLong(14); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ALTSUM, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":835 */ __pyx_25 = PyInt_FromLong(15); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ALTSUMDATA, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":836 */ __pyx_25 = PyInt_FromLong(16); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SKEETER, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":837 */ __pyx_25 = PyInt_FromLong(17); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_BUBBA, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":838 */ __pyx_25 = PyInt_FromLong(18); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TRAILSUM, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":839 */ __pyx_25 = PyInt_FromLong(19); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MD5, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":840 */ __pyx_25 = PyInt_FromLong(20); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SCPS, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":841 */ __pyx_25 = PyInt_FromLong(21); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SNACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":842 */ __pyx_25 = PyInt_FromLong(22); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_REC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":843 */ __pyx_25 = PyInt_FromLong(23); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CORRUPT, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":844 */ __pyx_25 = PyInt_FromLong(24); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SNAP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":845 */ __pyx_25 = PyInt_FromLong(26); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TCPCOMP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":846 */ __pyx_25 = PyInt_FromLong(27); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":848 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k49 = __pyx_25; __pyx_25 = 0; __pyx_26 = PyInt_FromLong(0); if (!__pyx_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k50 = __pyx_26; __pyx_26 = 0; __pyx_27 = __Pyx_GetName(__pyx_m, __pyx_n_TH_SYN); if (!__pyx_27) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k51 = __pyx_27; __pyx_27 = 0; __pyx_28 = __Pyx_GetName(__pyx_m, __pyx_n_TCP_WIN_MAX); if (!__pyx_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_k52 = __pyx_28; __pyx_28 = 0; __pyx_29 = PyInt_FromLong(0); if (!__pyx_29) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_k53 = __pyx_29; __pyx_29 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":871 */ __pyx_30 = PyInt_FromLong(8); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_UDP_HDR_LEN, __pyx_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} Py_DECREF(__pyx_30); __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":872 */ __pyx_30 = PyInt_FromLong(65535); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_UDP_PORT_MAX, __pyx_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} Py_DECREF(__pyx_30); __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":874 */ __pyx_30 = __Pyx_GetName(__pyx_m, __pyx_n_UDP_HDR_LEN); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;} __pyx_k54 = __pyx_30; __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":913 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_OTHER, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":914 */ __pyx_31 = PyInt_FromLong(6); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_ETH, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":915 */ __pyx_31 = PyInt_FromLong(24); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_LOOPBACK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":916 */ __pyx_31 = PyInt_FromLong(53); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_TUN, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":918 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_UP, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":919 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_LOOPBACK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":920 */ __pyx_31 = PyInt_FromLong(4); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_POINTOPOINT, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":921 */ __pyx_31 = PyInt_FromLong(8); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_NOARP, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":922 */ __pyx_31 = PyInt_FromLong(16); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_BROADCAST, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":923 */ __pyx_31 = PyInt_FromLong(32); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_MULTICAST, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1038 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1137 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1183 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_OP_ALLOW, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1184 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_OP_BLOCK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1186 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_DIR_IN, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1187 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_DIR_OUT, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1273 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1371 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1490 */ __pyx_31 = PyInt_FromLong(1500); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} __pyx_k59 = __pyx_31; __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1531 */ return; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); Py_XDECREF(__pyx_7); Py_XDECREF(__pyx_8); Py_XDECREF(__pyx_9); Py_XDECREF(__pyx_10); Py_XDECREF(__pyx_11); Py_XDECREF(__pyx_12); Py_XDECREF(__pyx_13); Py_XDECREF(__pyx_14); Py_XDECREF(__pyx_15); Py_XDECREF(__pyx_16); Py_XDECREF(__pyx_17); Py_XDECREF(__pyx_18); Py_XDECREF(__pyx_19); Py_XDECREF(__pyx_20); Py_XDECREF(__pyx_21); Py_XDECREF(__pyx_22); Py_XDECREF(__pyx_23); Py_XDECREF(__pyx_24); Py_XDECREF(__pyx_25); Py_XDECREF(__pyx_26); Py_XDECREF(__pyx_27); Py_XDECREF(__pyx_28); Py_XDECREF(__pyx_29); Py_XDECREF(__pyx_30); Py_XDECREF(__pyx_31); __Pyx_AddTraceback("dnet"); } static char *__pyx_filenames[] = { "dnet.pyx", }; /* Runtime support code */ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Argument '%s' has incorrect type (expected %s, got %s)", name, type->tp_name, obj->ob_type->tp_name); return 0; } static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); if (!result) PyErr_SetObject(PyExc_NameError, name); return result; } static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); } /* Next, repeatedly, replace a tuple exception with its first item */ while (PyTuple_Check(type) && PyTuple_Size(type) > 0) { PyObject *tmp = type; type = PyTuple_GET_ITEM(type, 0); Py_INCREF(type); Py_DECREF(tmp); } if (PyString_CheckExact(type)) { /* Raising builtin string is deprecated but still allowed -- * do nothing. Raising an instance of a new-style str * subclass is right out. */ if (PyErr_Warn(PyExc_DeprecationWarning, "raising a string exception is deprecated")) goto raise_error; } else if (PyType_Check(type) || PyClass_Check(type)) ; /* PyErr_NormalizeException(&type, &value, &tb); */ else if (PyInstance_Check(type)) { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } else { /* Normalize to raise , */ Py_DECREF(value); value = type; type = (PyObject*) ((PyInstanceObject*)type)->in_class; Py_INCREF(type); } } else if (PyType_IsSubtype(type->ob_type, (PyTypeObject*)PyExc_Exception)) { /* Raising a new-style object (in Py2.5). The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } else { /* Normalize to raise , */ Py_DECREF(value); value = type; type = (PyObject*) type->ob_type; Py_INCREF(type); } } else { /* Not something you can raise. You get an exception anyway, just not what you specified :-) */ PyErr_Format(PyExc_TypeError, "exceptions must be classes, instances, or " "strings (deprecated), not %s", type->ob_type->tp_name); goto raise_error; } PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if (obj == Py_None || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", obj->ob_type->tp_name, type->tp_name); return 0; } static void __Pyx_UnpackError(void) { PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } static PyObject *__Pyx_UnpackItem(PyObject *seq, Py_ssize_t i) { PyObject *item; if (!(item = PySequence_GetItem(seq, i))) { if (PyErr_ExceptionMatches(PyExc_IndexError)) __Pyx_UnpackError(); } return item; } static int __Pyx_EndUnpack(PyObject *seq, Py_ssize_t i) { PyObject *item; if (item = PySequence_GetItem(seq, i)) { Py_DECREF(item); __Pyx_UnpackError(); return -1; } PyErr_Clear(); return 0; } static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { while (t->p) { *t->p = PyString_InternFromString(t->s); if (!*t->p) return -1; ++t; } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); if (!*t->p) return -1; ++t; } return 0; } #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; PyObject *empty_tuple = 0; PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_srcfile = PyString_FromString(__pyx_filename); if (!py_srcfile) goto bad; py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; empty_tuple = PyTuple_New(0); if (!empty_tuple) goto bad; empty_string = PyString_FromString(""); if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ empty_string, /*PyObject *code,*/ empty_tuple, /*PyObject *consts,*/ empty_tuple, /*PyObject *names,*/ empty_tuple, /*PyObject *varnames,*/ empty_tuple, /*PyObject *freevars,*/ empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = __pyx_lineno; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); Py_XDECREF(empty_tuple); Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } libdnet-1.12/python/dnet.pyx0000644000076500007650000013763410554377551017275 0ustar dugsongdugsong00000000000000# # dnet.pyx # # $Id: dnet.pyx 638 2007-01-20 11:39:21Z dugsong $ """dumb networking library This module provides a simplified interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. """ __author__ = 'Dug Song ' __copyright__ = 'Copyright (c) 2003 Dug Song' __license__ = 'BSD' __url__ = 'http://libdnet.sourceforge.net/' __version__ = '1.12' cdef extern from "dnet.h": pass cdef extern from "Python.h": object PyString_FromStringAndSize(char *s, int len) int PyString_Size(object o) int PyObject_AsReadBuffer(object o, char **pp, int *lenp) int PyInt_Check(object o) int PyLong_Check(object o) long PyInt_AsLong(object o) unsigned long PyLong_AsUnsignedLong(object o) cdef extern from *: char *malloc(int size) void free(void *p) void *memcpy(char *dst, char *src, int len) void *memset(char *b, int c, int len) char *strerror(int errnum) int strlcpy(char *dst, char *src, int size) unsigned long htonl(unsigned long n) unsigned long ntohl(unsigned long n) cdef __memcpy(char *dst, object src, int n): if PyString_Size(src) != n: raise ValueError, "not a %d-byte binary string: %r" % (n, src) memcpy(dst, src, n) cdef __oserror(): cdef extern int errno return strerror(errno) def __iter_append(entry, l): l.append(entry) # # eth.h # cdef extern from *: ctypedef struct eth_t: int __xxx ctypedef struct eth_addr_t: char data[6] eth_t *eth_open(char *device) int eth_get(eth_t *eth, eth_addr_t *ea) int eth_set(eth_t *eth, eth_addr_t *ea) int eth_send(eth_t *eth, char *buf, int len) eth_t *eth_close(eth_t *eth) char *__eth_ntoa "eth_ntoa" (eth_addr_t *buf) int __eth_aton "eth_aton" (char *src, eth_addr_t *dst) void __eth_pack_hdr "eth_pack_hdr" (char *h, eth_addr_t dst, eth_addr_t src, int type) ETH_ADDR_LEN = 6 ETH_ADDR_BITS = 48 ETH_TYPE_LEN = 2 ETH_CRC_LEN = 4 ETH_HDR_LEN = 14 ETH_LEN_MIN = 64 # /* minimum frame length with CRC */ ETH_LEN_MAX = 1518 # /* maximum frame length with CRC */ ETH_MTU = (ETH_LEN_MAX - ETH_HDR_LEN - ETH_CRC_LEN) ETH_MIN = (ETH_LEN_MIN - ETH_HDR_LEN - ETH_CRC_LEN) ETH_TYPE_PUP = 0x0200 # /* PUP protocol */ ETH_TYPE_IP = 0x0800 # /* IP protocol */ ETH_TYPE_ARP = 0x0806 # /* address resolution protocol */ ETH_TYPE_REVARP=0x8035 # /* reverse addr resolution protocol */ ETH_TYPE_8021Q =0x8100 # /* IEEE 802.1Q VLAN tagging */ ETH_TYPE_IPV6 = 0x86DD # /* IPv6 protocol */ ETH_TYPE_MPLS = 0x8847 # /* MPLS */ ETH_TYPE_MPLS_MCAST = 0x8848 # /* MPLS Multicast */ ETH_TYPE_PPPOEDISC = 0x8863 # /* PPP Over Ethernet Discovery Stage */ ETH_TYPE_PPPOE = 0x8864 # /* PPP Over Ethernet Session Stage */ ETH_TYPE_LOOPBACK = 0x9000 # /* used to test interfaces */ ETH_ADDR_UNSPEC = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00", 6) ETH_ADDR_BROADCAST = PyString_FromStringAndSize("\xff\xff\xff\xff\xff\xff", 6) cdef class eth: """eth(device) -> Ethernet device object Open the specified Ethernet device for sending. """ cdef eth_t *eth def __init__(self, device): self.eth = eth_open(device) if not self.eth: raise OSError, __oserror() def get(self): """Return the MAC address associated with the device as a binary string.""" cdef eth_addr_t ea if eth_get(self.eth, &ea) < 0: raise OSError, __oserror() return PyString_FromStringAndSize(ea.data, 6) def set(self, value): """Set the MAC address for the device, returning 0 on success, -1 on failure. Arguments: eth_addr -- 6-byte binary string (e.g. '\\x00\\xde\\xad\\xbe\\xef\\x00') """ cdef eth_addr_t ea __memcpy(ea.data, value, 6) if eth_set(self.eth, &ea) < 0: raise OSError, __oserror() def send(self, frame): """Send an Ethernet frame, returning the number of bytes sent or -1 on failure. Arguments: frame -- binary string representing an Ethernet frame """ return eth_send(self.eth, frame, PyString_Size(frame)) def __dealloc__(self): if self.eth: eth_close(self.eth) def eth_ntoa(buf): """Convert an Ethernet MAC address from 6-byte packed binary string to a printable string ('00:de:ad:be:ef:00').""" cdef eth_addr_t ea __memcpy(ea.data, buf, 6) return __eth_ntoa(&ea) def eth_aton(buf): """Convert an Ethernet MAC address from a printable string to a packed binary string ('\\x00\\xde\\xad\\xbe\\xef\\x00').""" cdef eth_addr_t ea if __eth_aton(buf, &ea) < 0: raise ValueError, "invalid Ethernet address" return PyString_FromStringAndSize(ea.data, 6) def eth_pack_hdr(dst=ETH_ADDR_BROADCAST, src=ETH_ADDR_BROADCAST, type=ETH_TYPE_IP): """Return a packed binary string representing an Ethernet header. Keyword arguments: dst -- destination address (6-byte binary string) src -- source address (6-byte binary string) type -- Ethernet payload type (ETH_TYPE_*) (16-bit integer) """ cdef char hdr[14] cdef eth_addr_t s, d __memcpy(s.data, src, 6) __memcpy(d.data, dst, 6) __eth_pack_hdr(hdr, d, s, type) return PyString_FromStringAndSize(hdr, 14) # # ip.h # cdef extern from *: ctypedef struct ip_t: int __xxx ctypedef struct ip_addr_t: char data[4] ip_t *ip_open() int ip_send(ip_t *ip, char *buf, int len) ip_t *ip_close(ip_t *ip) char *__ip_ntoa "ip_ntoa" (ip_addr_t *buf) int __ip_aton "ip_aton" (char *src, ip_addr_t *dst) void __ip_checksum "ip_checksum" (char *buf, int len) int __ip_cksum_add "ip_cksum_add" (char *buf, int len, int sum) int __ip_cksum_carry "ip_cksum_carry" (int sum) void __ip_pack_hdr "ip_pack_hdr" (char *h, int tos, int len, int id, int off, int ttl, int p, ip_addr_t s, ip_addr_t d) IP_ADDR_LEN = 4 # /* IP address length */ IP_ADDR_BITS = 32 # /* IP address bits */ IP_HDR_LEN = 20 # /* base IP header length */ IP_OPT_LEN = 2 # /* base IP option length */ IP_OPT_LEN_MAX =40 IP_HDR_LEN_MAX =(IP_HDR_LEN + IP_OPT_LEN_MAX) IP_LEN_MAX = 65535 IP_LEN_MIN = IP_HDR_LEN IP_TOS_DEFAULT =0x00 # /* default */ IP_RF = 0x8000 # /* reserved */ IP_DF = 0x4000 # /* don't fragment */ IP_MF = 0x2000 # /* more fragments (not last frag) */ IP_OFFMASK = 0x1fff # /* mask for fragment offset */ IP_TTL_DEFAULT =64 # /* default ttl, RFC 1122, RFC 1340 */ IP_TTL_MAX = 255 # /* maximum ttl */ IP_PROTO_IP = 0 # /* dummy for IP */ IP_PROTO_ICMP = 1 # /* ICMP */ IP_PROTO_IGMP = 2 # /* IGMP */ IP_PROTO_TCP = 6 # /* TCP */ IP_PROTO_UDP = 17 # /* UDP */ IP_PROTO_IPV6 = 41 # /* IPv6 */ IP_PROTO_GRE = 47 # /* General Routing Encap */ IP_PROTO_ESP = 50 # /* Encap Security Payload */ IP_PROTO_AH = 51 # /* Authentication Header */ IP_PROTO_ICMPV6 = 58 # /* ICMP for IPv6 */ IP_PROTO_RAW = 255 # /* Raw IP packets */ IP_PROTO_RESERVED = IP_PROTO_RAW # /* Reserved */ IP_PROTO_MAX = 255 IP_ADDR_ANY = PyString_FromStringAndSize("\x00\x00\x00\x00", 4) IP_ADDR_BROADCAST = PyString_FromStringAndSize("\xff\xff\xff\xff", 4) IP_ADDR_LOOPBACK = PyString_FromStringAndSize("\x7f\x00\x00\x01", 4) IP_ADDR_MCAST_ALL = PyString_FromStringAndSize("\xe0\x00\x00\x01", 4) IP_ADDR_MCAST_LOCAL = PyString_FromStringAndSize("\xe0\x00\x00\xff", 4) cdef class ip: """ip() -> Raw IP object Open a raw IP socket for sending. """ cdef ip_t *ip def __init__(self): self.ip = ip_open() if not self.ip: raise OSError, __oserror() def send(self, pkt): """Send an IP packet, returning the number of bytes sent or -1 on failure. Arguments: pkt -- binary string representing an IP packet """ return ip_send(self.ip, pkt, PyString_Size(pkt)) def __dealloc__(self): if self.ip: ip_close(self.ip) def ip_ntoa(buf): """Convert an IP address from a 4-byte packed binary string or integer to a printable string ('10.0.0.1').""" cdef ip_addr_t ia cdef unsigned int i if PyInt_Check(buf) or PyLong_Check(buf): i = ntohl(buf) memcpy(&ia, &i, 4) else: __memcpy(&ia, buf, 4) return __ip_ntoa(&ia) def ip_aton(buf): """Convert an IP address from a printable string to a packed binary string ('\\x0a\\x00\\x00\\x01').""" cdef ip_addr_t ia if __ip_aton(buf, &ia) < 0: raise ValueError, "invalid IP address" return PyString_FromStringAndSize(&ia, 4) def ip_checksum(pkt): """Return packed binary string representing an IP packet with the IP and transport-layer checksums set. Arguments: pkt -- binary string representing an IP packet """ cdef char buf[2048] cdef char *p cdef int n if PyObject_AsReadBuffer(pkt, &p, &n) == 0: if n < 2048: memcpy(buf, p, n) __ip_checksum(buf, n) return PyString_FromStringAndSize(buf, n) p = malloc(n) memcpy(p, pkt, n) __ip_checksum(p, n) s = PyString_FromStringAndSize(p, n) free(p) return s raise TypeError def ip_cksum_add(buf, int sum): cdef char *p cdef int n if PyObject_AsReadBuffer(buf, &p, &n) == 0: return __ip_cksum_add(p, n, sum) else: raise TypeError def ip_cksum_carry(int sum): return __ip_cksum_carry(sum) def ip_pack_hdr(tos=IP_TOS_DEFAULT, len=IP_HDR_LEN, id=0, off=0, ttl=IP_TTL_DEFAULT, p=IP_PROTO_IP, src=IP_ADDR_ANY, dst=IP_ADDR_ANY): """Return a packed binary string representing an IP header. Keyword arguments: tos -- type of service (8-bit integer) len -- length (IP_HDR_LEN + payload) (16-bit integer) id -- packet ID (16-bit integer) off -- fragmentation offset (16-bit integer) ttl -- time-to-live (8-bit integer) p -- protocol (IP_PROTO_*) (8-bit integer) src -- source address (4-byte binary string) dst -- destination address (4-byte binary string) """ cdef char hdr[20] cdef ip_addr_t s, d __memcpy(&s, src, 4) __memcpy(&d, dst, 4) __ip_pack_hdr(hdr, tos, len, id, off, ttl, p, s, d) return PyString_FromStringAndSize(hdr, 20) # # ip6.h # cdef extern from *: ctypedef struct ip6_addr_t: char data[16] char *__ip6_ntoa "ip6_ntoa" (ip6_addr_t *buf) int __ip6_aton "ip6_aton" (char *src, ip6_addr_t *dst) void __ip6_checksum "ip6_checksum" (char *buf, int len) void __ip6_pack_hdr "ip6_pack_hdr" (char *h, int fd, int fl, int plen, int nxt, int hlim, ip6_addr_t s, ip6_addr_t d) IP6_ADDR_LEN = 16 IP6_ADDR_BITS = 128 IP6_HDR_LEN = 40 # /* IPv6 header length */ IP6_LEN_MIN = IP6_HDR_LEN IP6_LEN_MAX = 65535 # /* non-jumbo payload */ IP6_MTU_MIN = 1280 # /* minimum MTU (1024 + 256) */ IP6_HLIM_DEFAULT=64 IP6_HLIM_MAX = 255 IP6_ADDR_UNSPEC = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16) IP6_ADDR_LOOPBACK = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", 16) def ip6_ntoa(buf): """Convert an IPv6 address from a 16-byte packed binary string to a printable string ('10.0.0.1').""" cdef ip6_addr_t ia __memcpy(&ia, buf, 16) return __ip6_ntoa(&ia) def ip6_aton(buf): """Convert an IPv6 address from a printable string to a packed binary string ('\\x0a\\x00\\x00\\x01').""" cdef ip6_addr_t ia if __ip6_aton(buf, &ia) < 0: raise ValueError, "invalid IPv6 address" return PyString_FromStringAndSize(&ia, 16) def ip6_checksum(buf): """Return a packed binary string representing an IPv6 packet with the IPv6 and transport-layer checksums set. Arguments: pkt -- binary string representing an IPv6 packet """ __ip6_checksum(buf, PyString_Size(buf)) return buf def ip6_pack_hdr(fc=0, fl=0, plen=0, nxt=IP_PROTO_IPV6, hlim=IP6_HLIM_DEFAULT, src=IP6_ADDR_UNSPEC, dst=IP6_ADDR_UNSPEC): """Return a packed binary string representing an IPv6 header. Keyword arguments: fc -- flow class (8-bit integer) fl -- flow label (20-bit integer) plen -- payload length (16-bit integer) nxt -- next header (IP_PROTO_*) (8-bit integer) hlim -- hop limit (8-bit integer) src -- source address (16-byte binary string) dst -- destination address (16-byte binary string) """ cdef char hdr[40] cdef ip6_addr_t s, d __memcpy(&s, src, 16) __memcpy(&d, dst, 16) __ip6_pack_hdr(hdr, fc, fl, plen, nxt, hlim, s, d) return PyString_FromStringAndSize(hdr, 40) # # addr.h # cdef extern from *: cdef struct addr_t "addr": unsigned short addr_type unsigned short addr_bits char addr_data8[16] unsigned long addr_ip int addr_cmp(addr_t *a, addr_t *b) int addr_bcast(addr_t *a, addr_t *b) int addr_net(addr_t *a, addr_t *b) char *addr_ntoa(addr_t *a) int addr_aton(char *src, addr_t *dst) ADDR_TYPE_NONE = 0 ADDR_TYPE_ETH = 1 ADDR_TYPE_IP = 2 ADDR_TYPE_IP6 = 3 cdef class addr: """addr(addrtxt=None, type=ADDR_TYPE_NONE) -> network address object Create a network address object, optionally initialized from a human-readable Ethernet, IP, or IPv6 address string. """ cdef addr_t _addr def __init__(self, addrtxt=None, type=ADDR_TYPE_NONE): if addrtxt != None and addr_aton(addrtxt, &self._addr) < 0: if PyString_Size(addrtxt) == 4: self._addr.addr_type = ADDR_TYPE_IP self._addr.addr_bits = IP_ADDR_BITS self.ip = addrtxt else: raise ValueError, "invalid network address" property type: """Address type (ADDR_TYPE_*) integer.""" def __get__(self): return self._addr.addr_type def __set__(self, unsigned int value): if value > 0xffff: raise OverflowError self._addr.addr_type = value property bits: """Address bitlength integer.""" def __get__(self): return self._addr.addr_bits def __set__(self, unsigned int value): if value > 0xffff: raise OverflowError self._addr.addr_bits = value property data: """Raw address string.""" def __get__(self): if self._addr.addr_type == ADDR_TYPE_ETH: return self.eth elif self._addr.addr_type == ADDR_TYPE_IP: return self.ip elif self._addr.addr_type == ADDR_TYPE_IP6: return self.ip6 else: raise ValueError, "invalid network address" property eth: """Ethernet MAC address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_ETH: raise ValueError, "non-Ethernet address" return PyString_FromStringAndSize(self._addr.addr_data8, 6) def __set__(self, value): if PyString_Size(value) != ETH_ADDR_LEN: raise ValueError, "not a 6-byte string" __memcpy(self._addr.addr_data8, value, 6) self._addr.addr_type = ADDR_TYPE_ETH self._addr.addr_bits = ETH_ADDR_BITS property ip: """IPv4 address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_IP: raise ValueError, "non-IP address" return PyString_FromStringAndSize(self._addr.addr_data8, 4) def __set__(self, value): # XXX - handle < 2.3, or else we'd use PyInt_AsUnsignedLongMask() if PyInt_Check(value): self._addr.addr_ip = htonl(PyInt_AsLong(value)) elif PyLong_Check(value): self._addr.addr_ip = htonl(PyLong_AsUnsignedLong(value)) elif PyString_Size(value) != IP_ADDR_LEN: raise ValueError, "not a 4-byte string" else: __memcpy(self._addr.addr_data8, value, 4) self._addr.addr_type = ADDR_TYPE_IP self._addr.addr_bits = IP_ADDR_BITS property ip6: """IPv6 address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_IP6: raise ValueError, "non-IPv6 address" return PyString_FromStringAndSize(self._addr.addr_data8, 16) def __set__(self, value): if PyString_Size(value) != IP6_ADDR_LEN: raise ValueError, "not a 16-byte string" __memcpy(self._addr.addr_data8, value, 16) self._addr.addr_type = ADDR_TYPE_IP6 self._addr.addr_bits = IP6_ADDR_BITS def bcast(self): """Return an addr object for our broadcast address.""" bcast = addr() addr_bcast(&self._addr, &(bcast)._addr) return bcast def net(self): """Return an addr object for our network address.""" net = addr() addr_net(&self._addr, &(net)._addr) return net def __add__(self, other): # XXX - only handle IP for now... if PyInt_Check(self): x, y = other, self elif PyInt_Check(other): x, y = self, other else: raise NotImplementedError z = x.__copy__() (z)._addr.addr_ip = htonl(ntohl((x)._addr.addr_ip) + y) return z def __copy__(self): a = addr() (a)._addr = self._addr return a def __cmp__(addr x, addr y): cdef int i i = addr_cmp(&x._addr, &y._addr) if i < 0: return -1 if i > 0: return 1 return 0 def __contains__(self, addr other): cdef addr_t s1, s2, o1, o2 if addr_net(&self._addr, &s1) != 0 or \ addr_bcast(&self._addr, &s2) != 0 or \ addr_net(&other._addr, &o1) != 0 or \ addr_bcast(&other._addr, &o2) != 0: return 0 return addr_cmp(&o1, &s1) >= 0 and addr_cmp(&o2, &s2) <= 0 def __hash__(self): cdef long x, y, size if self._addr.addr_type == ADDR_TYPE_ETH: size = 6 elif self._addr.addr_type == ADDR_TYPE_IP: size = 4 elif self._addr.addr_type == ADDR_TYPE_IP6: size = 16 x = 0x345678 x = x ^ self._addr.addr_type x = x ^ self._addr.addr_bits y = self._addr.addr_data8[0] << 7 for i from 0 < i < size: y = (1000003 * y) ^ self._addr.addr_data8[i] y = y ^ size if y == -1: y = -2 x = x ^ y if x == -1: x = -2 return x def __int__(self): if self._addr.addr_type != ADDR_TYPE_IP: raise NotImplementedError return ntohl(self._addr.addr_ip) def __long__(self): return self.__int__() def __iter__(self): cdef addr_t a, b if self._addr.addr_type != ADDR_TYPE_IP or \ addr_net(&self._addr, &a) != 0 or \ addr_bcast(&self._addr, &b) != 0: raise ValueError """XXX - i wish! for i in ntohl(a.addr_ip) <= i <= ntohl(b.addr_ip): next = addr() next._addr.addr_type = ADDR_TYPE_IP next._addr.addr_bits = IP_ADDR_BITS next._addr.addr_ip = htonl(i) yield next """ return __addr_ip4_iter(a.addr_ip, b.addr_ip) def __repr__(self): cdef char *p p = addr_ntoa(&self._addr) if not p: return '' return p cdef class __addr_ip4_iter: cdef unsigned long cur # XXX - HBO cdef unsigned long max # XXX - HBO def __init__(self, cur, max): self.cur = ntohl(cur) self.max = ntohl(max) def __next__(self): cdef addr next if (self.cur <= self.max): next = addr() next._addr.addr_type = ADDR_TYPE_IP next._addr.addr_bits = IP_ADDR_BITS next._addr.addr_ip = htonl(self.cur) self.cur = self.cur + 1 return next else: raise StopIteration # # arp.h # cdef extern from *: cdef struct arp_entry: addr_t arp_pa addr_t arp_ha ctypedef struct arp_t: int __xxx ctypedef int (*arp_handler)(arp_entry *entry, void *arg) except -1 arp_t *arp_open() int arp_add(arp_t *arp, arp_entry *entry) int arp_delete(arp_t *arp, arp_entry *entry) int arp_get(arp_t *arp, arp_entry *entry) int arp_loop(arp_t *arp, arp_handler callback, void *arg) arp_t *arp_close(arp_t *arp) void __arp_pack_hdr_ethip "arp_pack_hdr_ethip" (char *buf, int op, eth_addr_t sha, ip_addr_t spa, eth_addr_t dha, ip_addr_t dpa) ARP_HDR_LEN = 8 # /* base ARP header length */ ARP_ETHIP_LEN = 20 # /* base ARP message length */ ARP_HRD_ETH = 0x0001 # /* ethernet hardware */ ARP_HRD_IEEE802=0x0006 # /* IEEE 802 hardware */ ARP_PRO_IP = 0x0800 # /* IP protocol */ ARP_OP_REQUEST = 1 # /* request to resolve ha given pa */ ARP_OP_REPLY = 2 # /* response giving hardware address */ ARP_OP_REVREQUEST = 3 # /* request to resolve pa given ha */ ARP_OP_REVREPLY = 4 # /* response giving protocol address */ cdef int __arp_callback(arp_entry *entry, void *arg) except -1: f, a = arg pa, ha = addr(), addr() (pa)._addr = entry.arp_pa (ha)._addr = entry.arp_ha ret = f((pa, ha), a) if not ret: ret = 0 return ret cdef class arp: """arp() -> ARP table object Open a handle to the system ARP table. """ cdef arp_t *arp def __init__(self): self.arp = arp_open() if not self.arp: raise OSError, __oserror() def add(self, addr pa, addr ha): """Add an entry to the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object ha -- ADDR_TYPE_ETH network address object """ cdef arp_entry entry entry.arp_pa = pa._addr entry.arp_ha = ha._addr if arp_add(self.arp, &entry) < 0: raise OSError, __oserror() def delete(self, addr pa): """Delete an entry from the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object """ cdef arp_entry entry entry.arp_pa = pa._addr if arp_delete(self.arp, &entry) < 0: raise OSError, __oserror() def get(self, addr pa): """Return the hardware address for a given protocol address in the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object """ cdef arp_entry entry entry.arp_pa = pa._addr if arp_get(self.arp, &entry) == 0: return addr(addr_ntoa(&entry.arp_ha)) return None def loop(self, callback, arg=None): """Iterate over the system ARP table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with ((pa, ha), arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return arp_loop(self.arp, __arp_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.arp: arp_close(self.arp) def arp_pack_hdr_ethip(op=ARP_OP_REQUEST, sha=ETH_ADDR_UNSPEC, spa=IP_ADDR_ANY, dha=ETH_ADDR_UNSPEC, dpa=IP_ADDR_ANY): """Return a packed binary string representing an Ethernet/IP ARP message. Keyword arguments: op -- operation (ARP_OP_*) (16-bit integer) sha -- sender Ethernet address (6-byte binary string) spa -- sender IP address (4-byte binary string) dha -- destination Ethernet address (6-byte binary string) dpa -- destination IP address (4-byte binary string) """ cdef char buf[28] cdef eth_addr_t sh, dh cdef ip_addr_t sp, dp __memcpy(sh.data, sha, 6) __memcpy(dh.data, dha, 6) __memcpy(&sp, spa, 4) __memcpy(&dp, dpa, 4) __arp_pack_hdr_ethip(buf, op, sh, sp, dh, dp) return PyString_FromStringAndSize(buf, 28) # # icmp.h # cdef extern from *: void __icmp_pack_hdr "icmp_pack_hdr" (char *hdr, int type, int code) def icmp_pack_hdr(type, code): """Return a packed binary string representing an ICMP header. Keyword arguments: type -- ICMP type (8-bit integer) code -- ICMP code (8-bit integer) """ cdef char buf[4] __icmp_pack_hdr(buf, type, code) return PyString_FromStringAndSize(buf, sizeof(buf)) # # tcp.h # cdef extern from *: void __tcp_pack_hdr "tcp_pack_hdr" (char *hdr, int sport, int dport, unsigned long seq, unsigned long ack, int flags, int win, int urp) TCP_HDR_LEN = 20 # /* base TCP header length */ TH_FIN = 0x01 # /* end of data */ TH_SYN = 0x02 # /* synchronize sequence numbers */ TH_RST = 0x04 # /* reset connection */ TH_PUSH = 0x08 # /* push */ TH_ACK = 0x10 # /* acknowledgement number set */ TH_URG = 0x20 # /* urgent pointer set */ TH_ECE = 0x40 # /* ECN echo, RFC 3168 */ TH_CWR = 0x80 # /* congestion window reduced */ TCP_PORT_MAX = 65535 # /* maximum port */ TCP_WIN_MAX = 65535 # /* maximum (unscaled) window */ TCP_OPT_EOL = 0 # /* end of option list */ TCP_OPT_NOP = 1 # /* no operation */ TCP_OPT_MSS = 2 # /* maximum segment size */ TCP_OPT_WSCALE = 3 # /* window scale factor, RFC 1072 */ TCP_OPT_SACKOK = 4 # /* SACK permitted, RFC 2018 */ TCP_OPT_SACK = 5 # /* SACK, RFC 2018 */ TCP_OPT_ECHO = 6 # /* echo (obsolete), RFC 1072 */ TCP_OPT_ECHOREPLY = 7 # /* echo reply (obsolete), RFC 1072 */ TCP_OPT_TIMESTAMP = 8 # /* timestamp, RFC 1323 */ TCP_OPT_POCONN = 9 # /* partial order conn, RFC 1693 */ TCP_OPT_POSVC = 10 # /* partial order service, RFC 1693 */ TCP_OPT_CC = 11 # /* connection count, RFC 1644 */ TCP_OPT_CCNEW = 12 # /* CC.NEW, RFC 1644 */ TCP_OPT_CCECHO = 13 # /* CC.ECHO, RFC 1644 */ TCP_OPT_ALTSUM = 14 # /* alt checksum request, RFC 1146 */ TCP_OPT_ALTSUMDATA = 15 # /* alt checksum data, RFC 1146 */ TCP_OPT_SKEETER = 16 # /* Skeeter */ TCP_OPT_BUBBA = 17 # /* Bubba */ TCP_OPT_TRAILSUM = 18 # /* trailer checksum */ TCP_OPT_MD5 = 19 # /* MD5 signature, RFC 2385 */ TCP_OPT_SCPS = 20 # /* SCPS capabilities */ TCP_OPT_SNACK = 21 # /* selective negative acks */ TCP_OPT_REC = 22 # /* record boundaries */ TCP_OPT_CORRUPT = 23 # /* corruption experienced */ TCP_OPT_SNAP = 24 # /* SNAP */ TCP_OPT_TCPCOMP = 26 # /* TCP compression filter */ TCP_OPT_MAX = 27 def tcp_pack_hdr(sport, dport, seq=1, ack=0, flags=TH_SYN, win=TCP_WIN_MAX, urp=0): """Return a packed binary string representing a TCP header. Keyword arguments: sport -- source port (16-bit integer) dport -- destination port (16-bit integer) seq -- sequence number (32-bit integer) ack -- acknowledgment number (32-bit integer) flags -- control flags (TH_*) (8-bit integer bitmask) win -- window size (16-bit integer) urp -- urgent pointer (16-bit integer) """ cdef char buf[20] __tcp_pack_hdr(buf, sport, dport, seq, ack, flags, win, urp) return PyString_FromStringAndSize(buf, sizeof(buf)) # # udp.h # cdef extern from *: void __udp_pack_hdr "udp_pack_hdr" (char *hdr, int sport, int dport, int ulen) UDP_HDR_LEN = 8 UDP_PORT_MAX = 65535 def udp_pack_hdr(sport, dport, ulen=UDP_HDR_LEN): """Return a packed binary string representing a UDP header. Keyword arguments: sport -- source port (16-bit integer) dport -- destination port (16-bit integer) ulen -- UDP header + data length (16-bit integer) """ cdef char buf[8] __udp_pack_hdr(buf, sport, dport, ulen) return PyString_FromStringAndSize(buf, sizeof(buf)) # # intf.h # cdef extern from *: struct intf_entry: unsigned int intf_len char intf_name[16] unsigned short intf_type unsigned short intf_flags unsigned int intf_mtu addr_t intf_addr addr_t intf_dst_addr addr_t intf_link_addr unsigned int intf_alias_num addr_t intf_alias_addrs[8] # XXX ctypedef struct intf_t: int __xxx ctypedef int (*intf_handler)(intf_entry *entry, void *arg) except -1 intf_t *intf_open() int intf_get(intf_t *intf, intf_entry *entry) int intf_get_src(intf_t *intf, intf_entry *entry, addr_t *src) int intf_get_dst(intf_t *intf, intf_entry *entry, addr_t *dst) int intf_set(intf_t *intf, intf_entry *entry) int intf_loop(intf_t *intf, intf_handler callback, void *arg) intf_t *intf_close(intf_t *intf) INTF_TYPE_OTHER = 1 # /* other */ INTF_TYPE_ETH = 6 # /* Ethernet */ INTF_TYPE_LOOPBACK = 24 # /* software loopback */ INTF_TYPE_TUN = 53 # /* proprietary virtual/internal */ INTF_FLAG_UP = 0x01 # /* enable interface */ INTF_FLAG_LOOPBACK = 0x02 # /* is a loopback net (r/o) */ INTF_FLAG_POINTOPOINT = 0x04 # /* point-to-point link (r/o) */ INTF_FLAG_NOARP = 0x08 # /* disable ARP */ INTF_FLAG_BROADCAST = 0x10 # /* supports broadcast (r/o) */ INTF_FLAG_MULTICAST = 0x20 # /* supports multicast (r/o) */ cdef object ifent_to_dict(intf_entry *entry): d = {} d['name'] = entry.intf_name d['type'] = entry.intf_type d['flags'] = entry.intf_flags d['mtu'] = entry.intf_mtu if entry.intf_addr.addr_type != ADDR_TYPE_NONE: d['addr'] = addr(addr_ntoa(&entry.intf_addr)) if entry.intf_dst_addr.addr_type != ADDR_TYPE_NONE: d['dst_addr'] = addr(addr_ntoa(&entry.intf_dst_addr)) if entry.intf_link_addr.addr_type != ADDR_TYPE_NONE: d['link_addr'] = addr(addr_ntoa(&entry.intf_link_addr)) if entry.intf_alias_num > 0: l = [] for i from 0 <= i < entry.intf_alias_num: l.append(addr(addr_ntoa(&entry.intf_alias_addrs[i]))) d['alias_addrs'] = l return d cdef dict_to_ifent(object d, intf_entry *entry): s = d['name'] strlcpy(entry.intf_name, s, 16) if 'flags' in d: entry.intf_flags = d['flags'] if 'mtu' in d: entry.intf_mtu = d['mtu'] if 'addr' in d: entry.intf_addr = (d['addr'])._addr if 'dst_addr' in d: entry.intf_dst_addr = (d['dst_addr'])._addr if 'link_addr' in d: entry.intf_link_addr = (d['link_addr'])._addr if 'alias_addrs' in d: entry.intf_alias_num = len(d['alias_addrs']) for i from 0 <= i < entry.intf_alias_num: entry.intf_alias_addrs[i] = (d['alias_addrs'][i])._addr cdef int __intf_callback(intf_entry *entry, void *arg) except -1: f, a = arg ret = f(ifent_to_dict(entry), a) if not ret: ret = 0 return ret cdef class intf: """intf() -> Interface table object Open a handle to the system network interface table. """ cdef intf_t *intf def __init__(self): self.intf = intf_open() if not self.intf: raise OSError, __oserror() def get(self, name): """Return the configuration for a network interface as a dict. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 strlcpy(ifent.intf_name, name, 16) if intf_get(self.intf, ifent) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def get_src(self, addr src): """Return the configuration for the interface whose primary address matches the specified source address. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 if intf_get_src(self.intf, ifent, &src._addr) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def get_dst(self, addr dst): """Return the configuration for the best interface with which to reach the specified dst address. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 if intf_get_dst(self.intf, ifent, &dst._addr) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def set(self, d): """Set the configuration for an interface from a dict. Dict values: name -- name of interface to set (string) flags -- interface flags (INTF_FLAG_*) (integer bitmask) mtu -- interface MTU (integer) addr -- primary network address (addr object) dst_addr -- point-to-point dst address (addr object) link_addr -- link-layer address (addr object) alias_addrs -- additional network addresses (list of addr objects) """ cdef intf_entry *ifent cdef char buf[1024] memset(buf, 0, sizeof(buf)) ifent = buf ifent.intf_len = 1024 dict_to_ifent(d, ifent) if intf_set(self.intf, ifent) < 0: raise OSError, __oserror() def loop(self, callback, arg=None): """Iterate over the system interface table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with (dict, arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return intf_loop(self.intf, __intf_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.intf: intf_close(self.intf) # # route.h # cdef extern from *: cdef struct route_entry: addr_t route_dst addr_t route_gw ctypedef struct route_t: int __xxx ctypedef int (*route_handler)(route_entry *entry, void *arg) except -1 route_t *route_open() int route_add(route_t *route, route_entry *entry) int route_delete(route_t *route, route_entry *entry) int route_get(route_t *route, route_entry *entry) int route_loop(route_t *route, route_handler callback, void *arg) route_t *route_close(route_t *route) cdef int __route_callback(route_entry *entry, void *arg) except -1: f, a = arg dst, gw = addr(), addr() (dst)._addr = entry.route_dst (gw)._addr = entry.route_gw ret = f((dst, gw), a) if not ret: ret = 0 return ret cdef class route: """route() -> Routing table object Open a handle to the system routing table. """ cdef route_t *route def __init__(self): self.route = route_open() if not self.route: raise OSError, __oserror() def add(self, addr dst, addr gw): """Add an entry to the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object gw -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr entry.route_gw = gw._addr if route_add(self.route, &entry) < 0: raise OSError, __oserror() def delete(self, addr dst): """Delete an entry from the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr if route_delete(self.route, &entry) < 0: raise OSError, __oserror() def get(self, addr dst): """Return the hardware address for a given protocol address in the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr if route_get(self.route, &entry) == 0: return addr(addr_ntoa(&entry.route_gw)) return None def loop(self, callback, arg=None): """Iterate over the system routing table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with ((dst, gw), arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return route_loop(self.route, __route_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.route: route_close(self.route) # # fw.h # cdef extern from *: cdef struct fw_rule: char fw_device[16] int fw_op int fw_dir int fw_proto addr_t fw_src addr_t fw_dst int fw_sport[2] int fw_dport[2] ctypedef struct fw_t: int __xxx ctypedef int (*fw_handler)(fw_rule *rule, void *arg) except -1 fw_t *fw_open() int fw_add(fw_t *f, fw_rule *rule) int fw_delete(fw_t *f, fw_rule *rule) int fw_loop(fw_t *f, fw_handler callback, void *arg) fw_t *fw_close(fw_t *f) FW_OP_ALLOW = 1 FW_OP_BLOCK = 2 FW_DIR_IN = 1 FW_DIR_OUT = 2 cdef object rule_to_dict(fw_rule *rule): d = {} d['device'] = rule.fw_device d['op'] = rule.fw_op d['dir'] = rule.fw_dir if rule.fw_proto != 0: d['proto'] = rule.fw_proto if rule.fw_src.addr_type != ADDR_TYPE_NONE: d['src'] = addr(addr_ntoa(&rule.fw_src)) if rule.fw_dst.addr_type != ADDR_TYPE_NONE: d['dst'] = addr(addr_ntoa(&rule.fw_dst)) if not (rule.fw_sport[0] == 0 and rule.fw_sport[1] == 0): d['sport'] = [ rule.fw_sport[0], rule.fw_sport[1] ] if not (rule.fw_dport[0] == 0 and rule.fw_dport[1] == 0): d['dport'] = [ rule.fw_dport[0], rule.fw_dport[1] ] return d cdef dict_to_rule(object d, fw_rule *rule): s = d['device'] strlcpy(rule.fw_device, s, 16) rule.fw_op = d['op'] rule.fw_dir = d['dir'] if 'proto' in d: rule.fw_proto = d['proto'] if rule.fw_proto == IP_PROTO_TCP or rule.fw_proto == IP_PROTO_UDP: rule.fw_sport[1] = 65535 rule.fw_dport[1] = 65535 if 'src' in d: rule.fw_src = (d['src'])._addr if 'dst' in d: rule.fw_dst = (d['dst'])._addr if 'sport' in d: rule.fw_sport[0] = d['sport'][0] rule.fw_sport[1] = d['sport'][1] if 'dport' in d: rule.fw_dport[0] = d['dport'][0] rule.fw_dport[1] = d['dport'][1] cdef int __fw_callback(fw_rule *rule, void *arg) except -1: f, a = arg ret = f(rule_to_dict(rule), a) if not ret: ret = 0 return ret cdef class fw: """fw() -> Firewall ruleset object Open a handle to the local network firewall configuration. """ cdef fw_t *fw def __init__(self): self.fw = fw_open() if not self.fw: raise OSError, __oserror() def add(self, d): """Add a firewall rule specified as a dict. Dict values: device -- interface name (string) op -- operation (FW_OP_*) (integer) dir -- direction (FW_DIR_*) (integer) proto -- IP protocol (IP_PROTO_*) (integer) src -- source address / net (addr object) dst -- destination address / net (addr object) sport -- source port range or ICMP type/mask (list of 2 integers) dport -- dest port range or ICMP code/mask (list of 2 integers) """ cdef fw_rule rule memset(&rule, 0, sizeof(rule)) dict_to_rule(d, &rule) if fw_add(self.fw, &rule) < 0: raise OSError, __oserror() def delete(self, d): """Delete a firewall rule specified as a dict.""" cdef fw_rule rule memset(&rule, 0, sizeof(rule)) dict_to_rule(d, &rule) if fw_delete(self.fw, &rule) < 0: raise OSError, __oserror() def loop(self, callback, arg=None): """Iterate over the local firewall ruleset, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with (dict, arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return fw_loop(self.fw, __fw_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.fw: fw_close(self.fw) # # rand.h # cdef extern from *: ctypedef struct rand_t: int __xxx rand_t *rand_open() int rand_get(rand_t *rand, char *buf, int len) int rand_set(rand_t *rand, char *seed, int len) int rand_add(rand_t *rand, char *buf, int len) unsigned int rand_uint8(rand_t *rand) unsigned int rand_uint16(rand_t *rand) unsigned long rand_uint32(rand_t *rand) rand_t *rand_close(rand_t *rand) cdef class rand: """rand() -> Pseudo-random number generator Obtain a handle for fast, cryptographically strong pseudo-random number generation. The starting seed is derived from the system random data source device (if one exists), or from the current time and random stack contents. """ cdef rand_t *rand def __init__(self): self.rand = rand_open() if not self.rand: raise OSError, __oserror() def get(self, len): """Return a string of random bytes. Arguments: len -- number of random bytes to generate """ cdef char buf[1024] cdef char *p if len <= 1024: rand_get(self.rand, buf, len) return PyString_FromStringAndSize(buf, len) p = malloc(len) rand_get(self.rand, p, len) s = PyString_FromStringAndSize(p, len) free(p) return s def set(self, buf): """Initialize the PRNG from a known seed. Arguments: string -- binary string seed value """ rand_set(self.rand, buf, PyString_Size(buf)) def add(self, buf): """Add additional entropy into the PRNG mix. Arguments: string -- binary string """ rand_add(self.rand, buf, PyString_Size(buf)) def uint8(self): """Return a random 8-bit integer.""" return rand_uint8(self.rand) def uint16(self): """Return a random 16-bit integer.""" return rand_uint16(self.rand) def uint32(self): """Return a random 32-bit integer.""" return rand_uint32(self.rand) def xrange(self, start, stop=None): """xrange([start,] stop) -> xrange object Return a random permutation iterator to walk an unsigned integer range, like xrange(). """ if stop == None: return __rand_xrange(self, 0, start) else: return __rand_xrange(self, start, stop) def __dealloc__(self): if self.rand: rand_close(self.rand) # Modified (variable block length) TEA by Niels Provos cdef enum: TEADELTA = 0x9e3779b9 TEAROUNDS = 32 TEASBOXSIZE = 128 TEASBOXSHIFT = 7 cdef class __rand_xrange: cdef rand_t *rand cdef unsigned long cur, enc, max, mask, start, sboxmask cdef unsigned int sbox[128] # TEASBOXSIZE cdef int left, right, kshift def __init__(self, r, start, stop): cdef unsigned int bits self.rand = (r).rand if PyInt_Check(start): self.start = PyInt_AsLong(start) elif PyLong_Check(start): self.start = PyLong_AsUnsignedLong(start) else: raise TypeError, 'start must be an integer' if PyInt_Check(start): self.max = PyInt_AsLong(stop) - self.start elif PyLong_Check(start): self.max = PyLong_AsUnsignedLong(stop) - self.start else: raise TypeError, 'stop must be an integer' # XXX - permute range once only! rand_get(self.rand, self.sbox, sizeof(self.sbox)) bits = 0 while self.max > (1 << bits): bits = bits + 1 self.left = bits / 2 self.right = bits - self.left self.mask = (1 << bits) - 1 if TEASBOXSIZE < (1 << self.left): self.sboxmask = TEASBOXSIZE - 1 self.kshift = TEASBOXSHIFT else: self.sboxmask = (1 << self.left) - 1 self.kshift = self.left def __iter__(self): self.cur = self.enc = 0 # XXX - rewind iterator, but do not permute range again! return self def __len__(self): return self.max def __next__(self): cdef unsigned long c, sum if self.cur == self.max: raise StopIteration self.cur = self.cur + 1 while 1: c = self.enc self.enc = self.enc + 1 sum = 0 for i from 0 < i < TEAROUNDS: sum = sum + TEADELTA c = c ^ (self.sbox[(c ^ sum) & self.sboxmask] << self.kshift) c = c + sum c = c & self.mask c = ((c << self.left) | (c >> self.right)) & self.mask if c < self.max: break return self.start + c # # tun.h # cdef extern from *: ctypedef struct tun_t: int __xxx tun_t *tun_open(addr_t *src, addr_t *dst, int mtu) int tun_fileno(tun_t *tun) char *tun_name(tun_t *tun) int tun_send(tun_t *tun, char *buf, int size) int tun_recv(tun_t *tun, char *buf, int size) tun_t *tun_close(tun_t *tun) cdef class tun: """tun(src, dst[, mtu]) -> Network tunnel interface handle Obtain a handle to a network tunnel interface, to which packets destined for dst are delivered (with source addresses rewritten to src), where they may be read by a userland process and processed as desired. Packets written back to the handle are injected into the kernel networking subsystem. """ cdef tun_t *tun cdef char *buf cdef int mtu def __init__(self, addr src, addr dst, mtu=1500): self.tun = tun_open(&src._addr, &dst._addr, mtu) self.mtu = mtu if not self.tun: raise OSError, __oserror() self.buf = malloc(mtu) property name: """Tunnel interface name.""" def __get__(self): return tun_name(self.tun) property fd: """File descriptor for tunnel handle.""" def __get__(self): return tun_fileno(self.tun) def fileno(self): """Return file descriptor for tunnel handle.""" return tun_fileno(self.tun) def send(self, pkt): """Send an IP packet, returning the number of bytes sent or -1 on failure. Arguments: pkt -- binary string representing an IP packet """ return tun_send(self.tun, pkt, PyString_Size(pkt)) def recv(self): """Return the next packet delivered to the tunnel interface.""" cdef int n n = tun_recv(self.tun, self.buf, self.mtu) if n < 0: raise OSError, __oserror() return PyString_FromStringAndSize(self.buf, n) def close(self): self.tun = tun_close(self.tun) def __dealloc__(self): if self.buf: free(self.buf) if self.tun: tun_close(self.tun) libdnet-1.12/python/Makefile.am0000644000076500007650000000115610207725127017611 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 601 2005-02-25 22:44:39Z dugsong $ include $(top_srcdir)/Makefile.am.common if PYTHON # XXX - nasty automake fudging here... noinst_SCRIPTS = python-build $(srcdir)/dnet.c: $(srcdir)/dnet.pyx pyrexc $(srcdir)/dnet.pyx python-build: $(srcdir)/dnet.c $(PYTHON) setup.py build touch python-build python-clean: rm -rf *build clean: python-clean distclean: clean python-install: $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix) install-exec-local: python-install TESTS = test.py else install-exec-local: endif EXTRA_DIST = dnet.pyx dnet.c setup.py.in test.py DISTCLEANFILES = *~ libdnet-1.12/python/Makefile.in0000644000076500007650000002054610554377612017635 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include # XXX - nasty automake fudging here... @PYTHON_TRUE@noinst_SCRIPTS = python-build @PYTHON_TRUE@TESTS = test.py EXTRA_DIST = dnet.pyx dnet.c setup.py.in test.py DISTCLEANFILES = *~ subdir = python mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = setup.py SCRIPTS = $(noinst_SCRIPTS) depcomp = am__depfiles_maybe = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in setup.py.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign python/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) setup.py: $(top_builddir)/config.status setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-exec-local install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distdir dvi dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-exec-local \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am @PYTHON_TRUE@$(srcdir)/dnet.c: $(srcdir)/dnet.pyx @PYTHON_TRUE@ pyrexc $(srcdir)/dnet.pyx @PYTHON_TRUE@python-build: $(srcdir)/dnet.c @PYTHON_TRUE@ $(PYTHON) setup.py build @PYTHON_TRUE@ touch python-build @PYTHON_TRUE@python-clean: @PYTHON_TRUE@ rm -rf *build @PYTHON_TRUE@clean: python-clean @PYTHON_TRUE@distclean: clean @PYTHON_TRUE@python-install: @PYTHON_TRUE@ $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix) @PYTHON_TRUE@install-exec-local: python-install @PYTHON_FALSE@install-exec-local: # 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: libdnet-1.12/python/pyrex.diff0000644000076500007650000000503310051046254017546 0ustar dugsongdugsong00000000000000--- PyrexTypes.py.orig Sat Oct 4 00:45:39 2003 +++ PyrexTypes.py Wed May 12 01:54:44 2004 @@ -296,6 +296,12 @@ self.is_returncode = is_returncode +class CULongType(CIntType): + + to_py_function = "PyLong_FromUnsignedLong" + from_py_function = "PyLong_AsUnsignedLong" + + class CLongLongType(CIntType): to_py_function = "PyLong_FromLongLong" @@ -636,7 +642,7 @@ c_uchar_type = CIntType(0, 0, "T_UBYTE") c_ushort_type = CIntType(1, 0, "T_USHORT") c_uint_type = CIntType(2, 0, "T_UINT") -c_ulong_type = CIntType(3, 0, "T_ULONG") +c_ulong_type = CULongType(3, 0, "T_ULONG") c_ulonglong_type = CULongLongType(4, 0) c_float_type = CFloatType(5, "T_FLOAT") --- TypeSlots.py.orig Wed May 12 01:55:19 2004 +++ TypeSlots.py Thu May 13 23:22:51 2004 @@ -359,10 +359,10 @@ intintargproc = Signature("Tii", 'r') objargfunc = Signature("TO", "O") objobjargproc = Signature("TOO", 'r') # typedef int (*objobjargproc)(PyObject *, PyObject *, PyObject *); -getreadbufferproc = Signature("TiP", 'r') # typedef int (*getreadbufferproc)(PyObject *, int, void **); -getwritebufferproc = Signature("TiP", 'r') # typedef int (*getwritebufferproc)(PyObject *, int, void **); -getsegcountproc = Signature("TI", 'r') # typedef int (*getsegcountproc)(PyObject *, int *); -getcharbufferproc = Signature("TiS", 'r') # typedef int (*getcharbufferproc)(PyObject *, int, const char **); +getreadbufferproc = Signature("TiP", 'i') # typedef int (*getreadbufferproc)(PyObject *, int, void **); +getwritebufferproc = Signature("TiP", 'i') # typedef int (*getwritebufferproc)(PyObject *, int, void **); +getsegcountproc = Signature("TI", 'i') # typedef int (*getsegcountproc)(PyObject *, int *); +getcharbufferproc = Signature("TiS", 'i') # typedef int (*getcharbufferproc)(PyObject *, int, const char **); objargproc = Signature("TO", 'r') # typedef int (*objobjproc)(PyObject *, PyObject *); # typedef int (*visitproc)(PyObject *, void *); # typedef int (*traverseproc)(PyObject *, visitproc, void *); @@ -461,7 +461,7 @@ MethodSlot(intintargfunc, "sq_slice", "__getslice__"), EmptySlot("sq_ass_item"), # mp_ass_subscript used instead SyntheticSlot("sq_ass_slice", ["__setslice__", "__delslice__"], "0"), - MethodSlot(objargproc, "sq_contains", "__contains__"), + MethodSlot(cmpfunc, "sq_contains", "__contains__"), EmptySlot("sq_inplace_concat"), # nb_inplace_add used instead EmptySlot("sq_inplace_repeat"), # nb_inplace_multiply used instead ) libdnet-1.12/python/setup.py.in0000644000076500007650000000306510363615225017675 0ustar dugsongdugsong00000000000000#!/usr/bin/env python import glob, os, sys from distutils.core import setup, Extension dnet_srcs = [ '@srcdir@/dnet.c' ] dnet_incdirs = [ '@top_srcdir@/include' ] dnet_libdirs = [] dnet_libs = [] dnet_extargs = [] dnet_extobj = [] if sys.platform == 'win32': winpcap_dir = '../../WPdpack' dnet_srcs.extend(['../src/addr-util.c', '../src/addr.c', '../src/blob.c', '../src/ip-util.c', '../src/ip6.c', '../src/rand.c', '../src/err.c', '../src/strlcat.c', '../src/strlcpy.c', '../src/err.c', '../src/strlcat.c', '../src/strlcpy.c', '../src/strsep.c', '../src/arp-win32.c', '../src/eth-win32.c', '../src/fw-pktfilter.c', '../src/intf-win32.c', '../src/ip-win32.c', '../src/route-win32.c', '../src/tun-none.c']) dnet_incdirs.append(winpcap_dir + '/Include') dnet_libdirs.append(winpcap_dir + '/Lib') dnet_libs.extend([ 'advapi32', 'iphlpapi', 'ws2_32', 'packet' ]) else: # XXX - can't build on Cygwin+MinGW yet. #if sys.platform == 'cygwin': # dnet_extargs.append('-mno-cygwin') dnet_extobj.extend(glob.glob('@top_builddir@/src/.libs/*.o')) dnet = Extension('dnet', dnet_srcs, include_dirs=dnet_incdirs, library_dirs=dnet_libdirs, libraries=dnet_libs, extra_compile_args=dnet_extargs, extra_objects=dnet_extobj) setup(name='dnet', version='@VERSION@', description='low-level networking library', author='Dug Song', author_email='dugsong@monkey.org', url='http://libdnet.sourceforge.net/', ext_modules = [ dnet ]) libdnet-1.12/python/test.py0000755000076500007650000002051510046250010017072 0ustar dugsongdugsong00000000000000#!/usr/bin/env python import sys, unittest sys.path.insert(0, './build') import dnet class AddrTestCase(unittest.TestCase): def test_addr_cmp(self): for atxt in ('1.2.3.0', '0:d:e:a:d:0', 'fe::ed:fa:ce:0'): a = dnet.addr(atxt) b = dnet.addr(atxt) assert a == b b = dnet.addr(atxt[:-1] + '1') assert a < b assert b > a def test_addr_bcast(self): d = { 32:'10.0.0.0', 31:'10.0.0.1', 30:'10.0.0.3', 29:'10.0.0.7', 28:'10.0.0.15', 27:'10.0.0.31', 26:'10.0.0.63', 25:'10.0.0.127', 24:'10.0.0.255', 23:'10.0.1.255', 22:'10.0.3.255', 21:'10.0.7.255', 20:'10.0.15.255', 19:'10.0.31.255' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.bcast() self.failUnless(b.__str__() == d[bits], 'wrong bcast for /%d' % bits) def test_addr_net(self): d = { 32:'1.255.255.255', 31:'1.255.255.254', 30:'1.255.255.252', 29:'1.255.255.248', 28:'1.255.255.240', 27:'1.255.255.224', 26:'1.255.255.192', 25:'1.255.255.128', 24:'1.255.255.0', 23:'1.255.254.0', 22:'1.255.252.0', 21:'1.255.248.0', 20:'1.255.240.0', 19:'1.255.224.0' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.net() self.failUnless(b.__str__() == d[bits], 'wrong net for /%d' % bits) def test_addr_properties(self): atxt = '1.2.3.4/24' a = dnet.addr(atxt) assert a.type == dnet.ADDR_TYPE_IP and a.bits == 24 assert a.ip == '\x01\x02\x03\x04' and a.__str__() == atxt try: self.failUnless(a.eth == 'xxx', 'invalid eth property') except ValueError: pass atxt = '00:0d:0e:0a:0d:00' a = dnet.addr(atxt) assert a == dnet.addr('0:d:E:a:D:0') assert a.type == dnet.ADDR_TYPE_ETH and a.bits == 48 assert a.eth == '\x00\x0d\x0e\x0a\x0d\x00' and a.__str__() == atxt try: self.failUnless(a.ip6 == 'xxx', 'invalid ip6 property') except ValueError: pass atxt = 'fe80::dead:beef:feed:face/48' a = dnet.addr(atxt) assert a == dnet.addr('fe80:0:0::dead:beef:feed:face/48') assert a.type == dnet.ADDR_TYPE_IP6 and a.bits == 48 assert a.ip6 == '\xfe\x80\x00\x00\x00\x00\x00\x00\xde\xad\xbe\xef\xfe\xed\xfa\xce' and a.__str__() == atxt try: self.failUnless(a.ip == 'xxx', 'invalid ip property') except ValueError: pass class ArpTestCase(unittest.TestCase): def setUp(self): self.arp = dnet.arp() self.failUnless(self.arp, "couldn't open ARP handle") def tearDown(self): del self.arp def test_arp(self): # XXX - site-specific values here! pa = dnet.addr('192.168.0.123') ha = dnet.addr('0:d:e:a:d:0') self.failUnless(self.arp.add(pa, ha) == None, "couldn't add ARP entry") self.failUnless(self.arp.get(pa) == ha, "couldn't find ARP entry") self.failUnless(self.arp.delete(pa) == None, "couldn't delete ARP entry") def __arp_cb(self, pa, ha, arg): # XXX - do nothing return arg def test_arp_loop(self): assert self.arp.loop(self.__arp_cb, 0) == 0 assert self.arp.loop(self.__arp_cb, 123) == 123 def test_arp_misc(self): sha = '\x00\x0d\x0e\x0a\x0d\x00' spa = '\x01\x02\x03\x04' dha = '\x00\x0b\x0e\x0e\x0f\x00' dpa = '\x05\x06\x07\x08' msg = dnet.arp_pack_hdr_ethip(dnet.ARP_OP_REQUEST, sha, spa, dha, dpa) assert msg == '\x00\x01\x08\x00\x06\x04\x00\x01\x00\r\x0e\n\r\x00\x01\x02\x03\x04\x00\x0b\x0e\x0e\x0f\x00\x05\x06\x07\x08' class EthTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.eth = dnet.eth(self.dev) self.failUnless(self.eth, "couldn't open Ethernet handle") def tearDown(self): del self.eth def test_eth_get(self): mac = self.eth.get() self.failUnless(mac, "couldn't get Ethernet address for %s" % self.dev) def test_eth_misc(self): n = "\x00\x0d\x0e\x0a\x0d\x00" a = '00:0d:0e:0a:0d:00' self.failUnless(dnet.eth_ntoa(n) == a) self.failUnless(dnet.eth_aton(a) == n) dst = "\x00\x0d\x0e\x0a\x0d\x01" self.failUnless(dnet.eth_pack_hdr(n, dst, dnet.ETH_TYPE_IP) == '\x00\r\x0e\n\r\x00\x00\r\x0e\n\r\x01\x08\x00') class FwTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.fw = dnet.fw() self.failUnless(self.fw, "couldn't open firewall handle") def tearDown(self): del self.fw def test_fw(self): src = dnet.addr('1.2.3.4') dst = dnet.addr('5.6.7.8') d = { 'device':self.dev, 'op':dnet.FW_OP_BLOCK, 'dir':dnet.FW_DIR_OUT, 'proto':dnet.IP_PROTO_UDP, 'src':src, 'dst':dst, 'dport':(660, 666) } self.failUnless(self.fw.add(d) == None, "couldn't add firewall rule: %s" % d) self.failUnless(self.fw.delete(d) == None, "couldn't delete firewall rule: %s" % d) def __fw_cb(self, rule, arg): # XXX - do nothing return arg def test_fw_loop(self): assert self.fw.loop(self.__fw_cb, 0) == 0 # XXX - no guarantee of existing fw rules. #assert self.fw.loop(self.__fw_cb, 123) == 123 class IntfTestCase(unittest.TestCase): def setUp(self): self.intf = dnet.intf() self.failUnless(self.intf, "couldn't open interface handle") def tearDown(self): del self.intf def test_intf_get(self): lo0 = self.intf.get('lo0') self.failUnless(lo0['name'] == 'lo0', "couldn't get loopback config") self.failUnless(self.intf.get_src(dnet.addr('127.0.0.1')) == lo0, "couldn't get_src 127.0.0.1") gw = self.intf.get_dst(dnet.addr('1.2.3.4')) self.failUnless(gw, "couldn't get outgoing interface") def test_intf_set(self): lo0 = self.intf.get('lo0') old_mtu = lo0['mtu'] new_mtu = 1234 lo0['mtu'] = new_mtu self.intf.set(lo0) lo0 = self.intf.get('lo0') assert lo0['mtu'] == new_mtu lo0['mtu'] = old_mtu self.intf.set(lo0) def __intf_cb(self, ifent, arg): # XXX - do nothing return arg def test_intf_loop(self): assert self.intf.loop(self.__intf_cb, 0) == 0 assert self.intf.loop(self.__intf_cb, 123) == 123 class IpTestCase(unittest.TestCase): def setUp(self): self.ip = dnet.ip() self.failUnless(self.ip, "couldn't open raw IP handle") def tearDown(self): del self.ip def test_ip_misc(self): n = '\x01\x02\x03\x04' a = '1.2.3.4' self.failUnless(dnet.ip_ntoa(n) == a) self.failUnless(dnet.ip_aton(a) == n) dst = '\x05\x06\x07\x08' hdr = dnet.ip_pack_hdr(0, dnet.IP_HDR_LEN, 666, 0, 255, dnet.IP_PROTO_UDP, n, dst) assert hdr == 'E\x00\x00\x14\x02\x9a\x00\x00\xff\x11\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' hdr = dnet.ip_checksum(hdr) assert hdr == 'E\x00\x00\x14\x02\x9a\x00\x00\xff\x11\xa9+\x01\x02\x03\x04\x05\x06\x07\x08' class RandTestCase(unittest.TestCase): def setUp(self): self.rand = dnet.rand() self.failUnless(self.rand, "couldn't open random handle") def tearDown(self): del self.rand class RouteTestCase(unittest.TestCase): def setUp(self): self.route = dnet.route() self.failUnless(self.route, "couldn't open route handle") def tearDown(self): del self.route def test_route(self): dst = dnet.addr('1.2.3.4/24') gw = dnet.addr('127.0.0.1') self.route.add(dst, gw) self.failUnless(self.route.get(dst) == gw) self.route.delete(dst) def __route_cb(self, dst, gw, arg): # XXX - do nothing return arg def test_route_loop(self): assert self.route.loop(self.__route_cb, 0) == 0 assert self.route.loop(self.__route_cb, 123) == 123 if __name__ == '__main__': unittest.main() libdnet-1.12/README0000644000076500007650000000065610204210541015102 0ustar dugsongdugsong00000000000000 libdnet ------- libdnet provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. WWW: http://libdnet.sourceforge.net/ $Id: README 578 2005-02-14 21:00:17Z dugsong $ libdnet-1.12/src/0000755000076500007650000000000010554406407015022 5ustar dugsongdugsong00000000000000libdnet-1.12/src/addr-util.c0000644000076500007650000001663010174652026017057 0ustar dugsongdugsong00000000000000/* * addr-util.c * * Copyright (c) 2002 Dug Song * * $Id: addr-util.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" static const char *octet2dec[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255" }; static const char *octet2hex[] = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff" }; char * eth_ntop(const eth_addr_t *eth, char *dst, size_t len) { const char *x; char *p = dst; int i; if (len < 18) return (NULL); for (i = 0; i < ETH_ADDR_LEN; i++) { for (x = octet2hex[eth->data[i]]; (*p = *x) != '\0'; x++, p++) ; *p++ = ':'; } p[-1] = '\0'; return (dst); } char * eth_ntoa(const eth_addr_t *eth) { struct addr a; addr_pack(&a, ADDR_TYPE_ETH, ETH_ADDR_BITS, eth->data, ETH_ADDR_LEN); return (addr_ntoa(&a)); } int eth_pton(const char *p, eth_addr_t *eth) { char *ep; long l; int i; for (i = 0; i < ETH_ADDR_LEN; i++) { l = strtol(p, &ep, 16); if (ep == p || l < 0 || l > 0xff || (i < ETH_ADDR_LEN - 1 && *ep != ':')) break; eth->data[i] = (u_char)l; p = ep + 1; } return ((i == ETH_ADDR_LEN && *ep == '\0') ? 0 : -1); } char * ip_ntop(const ip_addr_t *ip, char *dst, size_t len) { const char *d; char *p = dst; u_char *data = (u_char *)ip; int i; if (len < 16) return (NULL); for (i = 0; i < IP_ADDR_LEN; i++) { for (d = octet2dec[data[i]]; (*p = *d) != '\0'; d++, p++) ; *p++ = '.'; } p[-1] = '\0'; return (dst); } char * ip_ntoa(const ip_addr_t *ip) { struct addr a; addr_pack(&a, ADDR_TYPE_IP, IP_ADDR_BITS, ip, IP_ADDR_LEN); return (addr_ntoa(&a)); } int ip_pton(const char *p, ip_addr_t *ip) { u_char *data = (u_char *)ip; char *ep; long l; int i; for (i = 0; i < IP_ADDR_LEN; i++) { l = strtol(p, &ep, 10); if (ep == p || l < 0 || l > 0xff || (i < IP_ADDR_LEN - 1 && *ep != '.')) break; data[i] = (u_char)l; p = ep + 1; } return ((i == IP_ADDR_LEN && *ep == '\0') ? 0 : -1); } char * ip6_ntop(const ip6_addr_t *ip6, char *dst, size_t len) { struct { int base, len; } best, cur; char *p = dst; int i; if (len < 46) return (NULL); best.base = cur.base = -1; /* * Algorithm borrowed from Vixie's inet_pton6() */ for (i = 0; i < IP6_ADDR_LEN; i += 2) { if (*((uint16_t *)&ip6->data[i]) == 0) { if (cur.base == -1) { cur.base = i; cur.len = 0; } else cur.len += 2; } else { if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } } if (cur.base != -1 && (best.base == -1 || cur.len > best.len)) best = cur; if (best.base != -1 && best.len < 2) best.base = -1; if (best.base == 0) *p++ = ':'; for (i = 0; i < IP6_ADDR_LEN; i += 2) { if (i == best.base) { *p++ = ':'; i += best.len; } else if (i == 12 && best.base == 0 && (best.len == 10 || (best.len == 8 && *((uint16_t *)&ip6->data[10]) == 0xffff))) { if (ip_ntop((ip_addr_t *)&ip6->data[12], p, len - (p - dst)) == NULL) return (NULL); return (dst); } else p += sprintf(p, "%x:", ntohs(*((uint16_t *)&ip6->data[i]))); } if (best.base + 2 + best.len == IP6_ADDR_LEN) { *p = '\0'; } else p[-1] = '\0'; return (dst); } char * ip6_ntoa(const ip6_addr_t *ip6) { struct addr a; addr_pack(&a, ADDR_TYPE_IP6, IP6_ADDR_BITS, ip6->data, IP6_ADDR_LEN); return (addr_ntoa(&a)); } int ip6_pton(const char *p, ip6_addr_t *ip6) { uint16_t data[8], *u = (uint16_t *)ip6->data; int i, j, n, z = -1; char *ep; long l; if (*p == ':') p++; for (n = 0; n < 8; n++) { l = strtol(p, &ep, 16); if (ep == p) { if (ep[0] == ':' && z == -1) { z = n; p++; } else if (ep[0] == '\0') { break; } else { return (-1); } } else if (ep[0] == '.' && n <= 6) { if (ip_pton(p, (ip_addr_t *)(data + n)) < 0) return (-1); n += 2; ep = ""; /* XXX */ break; } else if (l >= 0 && l <= 0xffff) { data[n] = htons((uint16_t)l); if (ep[0] == '\0') { n++; break; } else if (ep[0] != ':' || ep[1] == '\0') return (-1); p = ep + 1; } else return (-1); } if (n == 0 || *ep != '\0' || (z == -1 && n != 8)) return (-1); for (i = 0; i < z; i++) { u[i] = data[i]; } while (i < 8 - (n - z - 1)) { u[i++] = 0; } for (j = z + 1; i < 8; i++, j++) { u[i] = data[j]; } return (0); } libdnet-1.12/src/addr.c0000644000076500007650000002317110257571236016107 0ustar dugsongdugsong00000000000000/* * addr.c * * Network address operations. * * Copyright (c) 2000 Dug Song * * $Id: addr.c 610 2005-06-26 18:23:26Z dugsong $ */ #include "config.h" #include #ifdef HAVE_NET_IF_H # include # include #endif #ifdef HAVE_NET_IF_DL_H # include #endif #ifdef HAVE_NET_RAW_H # include #endif #include #include #include #include #include #include "dnet.h" #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 256 #endif union sockunion { #ifdef HAVE_NET_IF_DL_H struct sockaddr_dl sdl; #endif struct sockaddr_in sin; #ifdef HAVE_SOCKADDR_IN6 struct sockaddr_in6 sin6; #endif struct sockaddr sa; #ifdef AF_RAW struct sockaddr_raw sr; #endif }; int addr_cmp(const struct addr *a, const struct addr *b) { int i, j, k; /* XXX */ if ((i = a->addr_type - b->addr_type) != 0) return (i); /* XXX - 10.0.0.1 is "smaller" than 10.0.0.0/8? */ if ((i = a->addr_bits - b->addr_bits) != 0) return (i); j = b->addr_bits / 8; for (i = 0; i < j; i++) { if ((k = a->addr_data8[i] - b->addr_data8[i]) != 0) return (k); } if ((k = b->addr_bits % 8) == 0) return (0); k = ~0 << (8 - k); i = b->addr_data8[j] & k; j = a->addr_data8[j] & k; return (j - i); } int addr_net(const struct addr *a, struct addr *b) { uint32_t mask; int i, j; if (a->addr_type == ADDR_TYPE_IP) { addr_btom(a->addr_bits, &mask, IP_ADDR_LEN); b->addr_type = ADDR_TYPE_IP; b->addr_bits = IP_ADDR_BITS; b->addr_ip = a->addr_ip & mask; } else if (a->addr_type == ADDR_TYPE_ETH) { memcpy(b, a, sizeof(*b)); if (a->addr_data8[0] & 0x1) memset(b->addr_data8 + 3, 0, 3); b->addr_bits = ETH_ADDR_BITS; } else if (a->addr_type == ADDR_TYPE_IP6) { b->addr_type = ADDR_TYPE_IP6; b->addr_bits = IP6_ADDR_BITS; memset(&b->addr_ip6, 0, IP6_ADDR_LEN); switch ((i = a->addr_bits / 32)) { case 4: b->addr_data32[3] = a->addr_data32[3]; case 3: b->addr_data32[2] = a->addr_data32[2]; case 2: b->addr_data32[1] = a->addr_data32[1]; case 1: b->addr_data32[0] = a->addr_data32[0]; } if ((j = a->addr_bits % 32) > 0) { addr_btom(j, &mask, sizeof(mask)); b->addr_data32[i] = a->addr_data32[i] & mask; } } else return (-1); return (0); } int addr_bcast(const struct addr *a, struct addr *b) { struct addr mask; if (a->addr_type == ADDR_TYPE_IP) { addr_btom(a->addr_bits, &mask.addr_ip, IP_ADDR_LEN); b->addr_type = ADDR_TYPE_IP; b->addr_bits = IP_ADDR_BITS; b->addr_ip = (a->addr_ip & mask.addr_ip) | (~0L & ~mask.addr_ip); } else if (a->addr_type == ADDR_TYPE_ETH) { b->addr_type = ADDR_TYPE_ETH; b->addr_bits = ETH_ADDR_BITS; memcpy(&b->addr_eth, ETH_ADDR_BROADCAST, ETH_ADDR_LEN); } else { /* XXX - no broadcast addresses in IPv6 */ errno = EINVAL; return (-1); } return (0); } char * addr_ntop(const struct addr *src, char *dst, size_t size) { if (src->addr_type == ADDR_TYPE_IP && size >= 20) { if (ip_ntop(&src->addr_ip, dst, size) != NULL) { if (src->addr_bits != IP_ADDR_BITS) sprintf(dst + strlen(dst), "/%d", src->addr_bits); return (dst); } } else if (src->addr_type == ADDR_TYPE_IP6 && size >= 42) { if (ip6_ntop(&src->addr_ip6, dst, size) != NULL) { if (src->addr_bits != IP6_ADDR_BITS) sprintf(dst + strlen(dst), "/%d", src->addr_bits); return (dst); } } else if (src->addr_type == ADDR_TYPE_ETH && size >= 18) { if (src->addr_bits == ETH_ADDR_BITS) return (eth_ntop(&src->addr_eth, dst, size)); } errno = EINVAL; return (NULL); } int addr_pton(const char *src, struct addr *dst) { struct hostent *hp; char *ep, tmp[300]; long bits = -1; int i; for (i = 0; i < (int)sizeof(tmp) - 1; i++) { if (src[i] == '/') { tmp[i] = '\0'; if (strchr(&src[i + 1], '.')) { uint32_t m; uint16_t b; /* XXX - mask is specified like /255.0.0.0 */ if (ip_pton(&src[i + 1], &m) != 0) { errno = EINVAL; return (-1); } addr_mtob(&m, sizeof(m), &b); bits = b; } else { bits = strtol(&src[i + 1], &ep, 10); if (ep == src || *ep != '\0' || bits < 0) { errno = EINVAL; return (-1); } } break; } else if ((tmp[i] = src[i]) == '\0') break; } if (ip_pton(tmp, &dst->addr_ip) == 0) { dst->addr_type = ADDR_TYPE_IP; dst->addr_bits = IP_ADDR_BITS; } else if (eth_pton(tmp, &dst->addr_eth) == 0) { dst->addr_type = ADDR_TYPE_ETH; dst->addr_bits = ETH_ADDR_BITS; } else if (ip6_pton(tmp, &dst->addr_ip6) == 0) { dst->addr_type = ADDR_TYPE_IP6; dst->addr_bits = IP6_ADDR_BITS; } else if ((hp = gethostbyname(tmp)) != NULL) { memcpy(&dst->addr_ip, hp->h_addr, IP_ADDR_LEN); dst->addr_type = ADDR_TYPE_IP; dst->addr_bits = IP_ADDR_BITS; } else { errno = EINVAL; return (-1); } if (bits >= 0) { if (bits > dst->addr_bits) { errno = EINVAL; return (-1); } dst->addr_bits = (uint16_t)bits; } return (0); } char * addr_ntoa(const struct addr *a) { static char *p, buf[BUFSIZ]; char *q = NULL; if (p == NULL || p > buf + sizeof(buf) - 64 /* XXX */) p = buf; if (addr_ntop(a, p, (buf + sizeof(buf)) - p) != NULL) { q = p; p += strlen(p) + 1; } return (q); } int addr_ntos(const struct addr *a, struct sockaddr *sa) { union sockunion *so = (union sockunion *)sa; switch (a->addr_type) { case ADDR_TYPE_ETH: #ifdef HAVE_NET_IF_DL_H memset(&so->sdl, 0, sizeof(so->sdl)); # ifdef HAVE_SOCKADDR_SA_LEN so->sdl.sdl_len = sizeof(so->sdl); # endif so->sdl.sdl_family = AF_LINK; so->sdl.sdl_alen = ETH_ADDR_LEN; memcpy(LLADDR(&so->sdl), &a->addr_eth, ETH_ADDR_LEN); #else memset(sa, 0, sizeof(*sa)); # ifdef AF_LINK sa->sa_family = AF_LINK; # else sa->sa_family = AF_UNSPEC; # endif memcpy(sa->sa_data, &a->addr_eth, ETH_ADDR_LEN); #endif break; #ifdef HAVE_SOCKADDR_IN6 case ADDR_TYPE_IP6: memset(&so->sin6, 0, sizeof(so->sin6)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin6.sin6_len = sizeof(so->sin6); #endif so->sin6.sin6_family = AF_INET6; memcpy(&so->sin6.sin6_addr, &a->addr_ip6, IP6_ADDR_LEN); break; #endif case ADDR_TYPE_IP: memset(&so->sin, 0, sizeof(so->sin)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin.sin_len = sizeof(so->sin); #endif so->sin.sin_family = AF_INET; so->sin.sin_addr.s_addr = a->addr_ip; break; default: errno = EINVAL; return (-1); } return (0); } int addr_ston(const struct sockaddr *sa, struct addr *a) { union sockunion *so = (union sockunion *)sa; memset(a, 0, sizeof(*a)); switch (sa->sa_family) { #ifdef HAVE_NET_IF_DL_H case AF_LINK: if (so->sdl.sdl_alen != ETH_ADDR_LEN) { errno = EINVAL; return (-1); } a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, LLADDR(&so->sdl), ETH_ADDR_LEN); break; #endif case AF_UNSPEC: case ARP_HRD_ETH: /* XXX- Linux arp(7) */ a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, sa->sa_data, ETH_ADDR_LEN); break; #ifdef AF_RAW case AF_RAW: /* XXX - IRIX raw(7f) */ a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, so->sr.sr_addr, ETH_ADDR_LEN); break; #endif #ifdef HAVE_SOCKADDR_IN6 case AF_INET6: a->addr_type = ADDR_TYPE_IP6; a->addr_bits = IP6_ADDR_BITS; memcpy(&a->addr_ip6, &so->sin6.sin6_addr, IP6_ADDR_LEN); break; #endif case AF_INET: a->addr_type = ADDR_TYPE_IP; a->addr_bits = IP_ADDR_BITS; a->addr_ip = so->sin.sin_addr.s_addr; break; default: errno = EINVAL; return (-1); } return (0); } int addr_btos(uint16_t bits, struct sockaddr *sa) { union sockunion *so = (union sockunion *)sa; #ifdef HAVE_SOCKADDR_IN6 if (bits > IP_ADDR_BITS && bits <= IP6_ADDR_BITS) { memset(&so->sin6, 0, sizeof(so->sin6)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin6.sin6_len = IP6_ADDR_LEN + (bits / 8) + (bits % 8); #endif so->sin6.sin6_family = AF_INET6; return (addr_btom(bits, &so->sin6.sin6_addr, IP6_ADDR_LEN)); } else #endif if (bits <= IP_ADDR_BITS) { memset(&so->sin, 0, sizeof(so->sin)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin.sin_len = IP_ADDR_LEN + (bits / 8) + (bits % 8); #endif so->sin.sin_family = AF_INET; return (addr_btom(bits, &so->sin.sin_addr, IP_ADDR_LEN)); } errno = EINVAL; return (-1); } int addr_stob(const struct sockaddr *sa, uint16_t *bits) { union sockunion *so = (union sockunion *)sa; int i, j, len; uint16_t n; u_char *p; #ifdef HAVE_SOCKADDR_IN6 if (sa->sa_family == AF_INET6) { len = IP6_ADDR_LEN; p = (u_char *)&so->sin6.sin6_addr; } else #endif { #ifdef HAVE_SOCKADDR_SA_LEN if ((len = sa->sa_len - IP_ADDR_LEN) > IP_ADDR_LEN) #endif len = IP_ADDR_LEN; p = (u_char *)&so->sin.sin_addr.s_addr; } for (n = i = 0; i < len; i++, n += 8) { if (p[i] != 0xff) break; } if (i != len && p[i]) { for (j = 7; j > 0; j--, n++) { if ((p[i] & (1 << j)) == 0) break; } } *bits = n; return (0); } int addr_btom(uint16_t bits, void *mask, size_t size) { int net, host; u_char *p; if (size == IP_ADDR_LEN) { if (bits > IP_ADDR_BITS) { errno = EINVAL; return (-1); } *(uint32_t *)mask = bits ? htonl(~0 << (IP_ADDR_BITS - bits)) : 0; } else { if (size * 8 < bits) { errno = EINVAL; return (-1); } p = (u_char *)mask; if ((net = bits / 8) > 0) memset(p, 0xff, net); if ((host = bits % 8) > 0) { p[net] = 0xff << (8 - host); memset(&p[net + 1], 0, size - net - 1); } else memset(&p[net], 0, size - net); } return (0); } int addr_mtob(const void *mask, size_t size, uint16_t *bits) { uint16_t n; u_char *p; int i, j; p = (u_char *)mask; for (n = i = 0; i < (int)size; i++, n += 8) { if (p[i] != 0xff) break; } if (i != (int)size && p[i]) { for (j = 7; j > 0; j--, n++) { if ((p[i] & (1 << j)) == 0) break; } } *bits = n; return (0); } libdnet-1.12/src/arp-bsd.c0000644000076500007650000001523610174652026016523 0ustar dugsongdugsong00000000000000/* * arp-bsd.c * * Copyright (c) 2000 Dug Song * * $Id: arp-bsd.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_STREAMS_ROUTE #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct arp_handle { int fd; int seq; }; struct arpmsg { struct rt_msghdr rtm; u_char addrs[256]; }; arp_t * arp_open(void) { arp_t *arp; if ((arp = calloc(1, sizeof(*arp))) != NULL) { #ifdef HAVE_STREAMS_ROUTE if ((arp->fd = open("/dev/route", O_RDWR, 0)) < 0) #else if ((arp->fd = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) #endif return (arp_close(arp)); } return (arp); } static int arp_msg(arp_t *arp, struct arpmsg *msg) { struct arpmsg smsg; int len, i = 0; pid_t pid; msg->rtm.rtm_version = RTM_VERSION; msg->rtm.rtm_seq = ++arp->seq; memcpy(&smsg, msg, sizeof(smsg)); #ifdef HAVE_STREAMS_ROUTE return (ioctl(arp->fd, RTSTR_SEND, &msg->rtm)); #else if (write(arp->fd, &smsg, smsg.rtm.rtm_msglen) < 0) { if (errno != ESRCH || msg->rtm.rtm_type != RTM_DELETE) return (-1); } pid = getpid(); /* XXX - should we only read RTM_GET responses here? */ while ((len = read(arp->fd, msg, sizeof(*msg))) > 0) { if (len < (int)sizeof(msg->rtm)) return (-1); if (msg->rtm.rtm_pid == pid) { if (msg->rtm.rtm_seq == arp->seq) break; continue; } else if ((i++ % 2) == 0) continue; /* Repeat request. */ if (write(arp->fd, &smsg, smsg.rtm.rtm_msglen) < 0) { if (errno != ESRCH || msg->rtm.rtm_type != RTM_DELETE) return (-1); } } if (len < 0) return (-1); return (0); #endif } int arp_add(arp_t *arp, const struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; int index, type; if (entry->arp_pa.addr_type != ADDR_TYPE_IP || entry->arp_ha.addr_type != ADDR_TYPE_ETH) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa)) { errno = EADDRNOTAVAIL; return (-1); } if (sin->sin_addr.s_addr == entry->arp_pa.addr_ip) { if ((msg.rtm.rtm_flags & RTF_LLINFO) == 0 || (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) { errno = EADDRINUSE; return (-1); } } if (sa->sa_family != AF_LINK) { errno = EADDRNOTAVAIL; return (-1); } else { index = ((struct sockaddr_dl *)sa)->sdl_index; type = ((struct sockaddr_dl *)sa)->sdl_type; } if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0 || addr_ntos(&entry->arp_ha, sa) < 0) return (-1); ((struct sockaddr_dl *)sa)->sdl_index = index; ((struct sockaddr_dl *)sa)->sdl_type = type; memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_ADD; msg.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; msg.rtm.rtm_inits = RTV_EXPIRE; msg.rtm.rtm_flags = RTF_HOST | RTF_STATIC; #ifdef HAVE_SOCKADDR_SA_LEN msg.rtm.rtm_msglen = sizeof(msg.rtm) + sin->sin_len + sa->sa_len; #else msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa); #endif return (arp_msg(arp, &msg)); } int arp_delete(arp_t *arp, const struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; if (entry->arp_pa.addr_type != ADDR_TYPE_IP) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa)) { errno = ESRCH; return (-1); } if (sin->sin_addr.s_addr == entry->arp_pa.addr_ip) { if ((msg.rtm.rtm_flags & RTF_LLINFO) == 0 || (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) { errno = EADDRINUSE; return (-1); } } if (sa->sa_family != AF_LINK) { errno = ESRCH; return (-1); } msg.rtm.rtm_type = RTM_DELETE; return (arp_msg(arp, &msg)); } int arp_get(arp_t *arp, struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; if (entry->arp_pa.addr_type != ADDR_TYPE_IP) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_flags = RTF_LLINFO; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa) || sin->sin_addr.s_addr != entry->arp_pa.addr_ip || sa->sa_family != AF_LINK) { errno = ESRCH; return (-1); } if (addr_ston(sa, &entry->arp_ha) < 0) return (-1); return (0); } #ifdef HAVE_SYS_SYSCTL_H int arp_loop(arp_t *arp, arp_handler callback, void *arg) { struct arp_entry entry; struct rt_msghdr *rtm; struct sockaddr_in *sin; struct sockaddr *sa; char *buf, *lim, *next; size_t len; int ret, mib[6] = { CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO }; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if (len == 0) return (0); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } lim = buf + len; ret = 0; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in *)(rtm + 1); sa = (struct sockaddr *)(sin + 1); if (addr_ston((struct sockaddr *)sin, &entry.arp_pa) < 0 || addr_ston(sa, &entry.arp_ha) < 0) continue; if ((ret = callback(&entry, arg)) != 0) break; } free(buf); return (ret); } #else int arp_loop(arp_t *arp, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif arp_t * arp_close(arp_t *arp) { if (arp != NULL) { if (arp->fd >= 0) close(arp->fd); free(arp); } return (NULL); } libdnet-1.12/src/arp-ioctl.c0000644000076500007650000002435410202507444017061 0ustar dugsongdugsong00000000000000/* * arp-ioctl.c * * Copyright (c) 2001 Dug Song * * $Id: arp-ioctl.c 554 2005-02-09 22:31:00Z dugsong $ */ #include "config.h" #include #include #include #include #ifdef HAVE_STREAMS_MIB2 # include # include # include # include # include # include # include # undef IP_ADDR_LEN #elif defined(HAVE_SYS_MIB_H) # include #endif #include #include #ifdef HAVE_STREAMS_MIB2 # include # include #endif #include #include #include #include #include #include #include "dnet.h" #ifdef HAVE_LINUX_PROCFS #define PROC_ARP_FILE "/proc/net/arp" #endif struct arp_handle { int fd; #ifdef HAVE_ARPREQ_ARP_DEV intf_t *intf; #endif }; arp_t * arp_open(void) { arp_t *a; if ((a = calloc(1, sizeof(*a))) != NULL) { #ifdef HAVE_STREAMS_MIB2 if ((a->fd = open(IP_DEV_NAME, O_RDWR)) < 0) #elif defined(HAVE_STREAMS_ROUTE) if ((a->fd = open("/dev/route", O_WRONLY, 0)) < 0) #else if ((a->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) #endif return (arp_close(a)); #ifdef HAVE_ARPREQ_ARP_DEV if ((a->intf = intf_open()) == NULL) return (arp_close(a)); #endif } return (a); } #ifdef HAVE_ARPREQ_ARP_DEV static int _arp_set_dev(const struct intf_entry *entry, void *arg) { struct arpreq *ar = (struct arpreq *)arg; struct addr dst; uint32_t mask; if (entry->intf_type == INTF_TYPE_ETH && entry->intf_addr.addr_type == ADDR_TYPE_IP) { addr_btom(entry->intf_addr.addr_bits, &mask, IP_ADDR_LEN); addr_ston((struct sockaddr *)&ar->arp_pa, &dst); if ((entry->intf_addr.addr_ip & mask) == (dst.addr_ip & mask)) { strlcpy(ar->arp_dev, entry->intf_name, sizeof(ar->arp_dev)); return (1); } } return (0); } #endif int arp_add(arp_t *a, const struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); /* XXX - see arp(7) for details... */ #ifdef __linux__ if (addr_ntos(&entry->arp_ha, &ar.arp_ha) < 0) return (-1); ar.arp_ha.sa_family = ARP_HRD_ETH; #else /* XXX - Solaris, HP-UX, IRIX, other Mentat stacks? */ ar.arp_ha.sa_family = AF_UNSPEC; memcpy(ar.arp_ha.sa_data, &entry->arp_ha.addr_eth, ETH_ADDR_LEN); #endif #ifdef HAVE_ARPREQ_ARP_DEV if (intf_loop(a->intf, _arp_set_dev, &ar) != 1) { errno = ESRCH; return (-1); } #endif ar.arp_flags = ATF_PERM | ATF_COM; #ifdef hpux /* XXX - screwy extended arpreq struct */ { struct sockaddr_in *sin; ar.arp_hw_addr_len = ETH_ADDR_LEN; sin = (struct sockaddr_in *)&ar.arp_pa_mask; sin->sin_family = AF_INET; sin->sin_addr.s_addr = IP_ADDR_BROADCAST; } #endif if (ioctl(a->fd, SIOCSARP, &ar) < 0) return (-1); #ifdef HAVE_STREAMS_MIB2 /* XXX - force entry into ipNetToMediaTable. */ { struct sockaddr_in sin; int fd; addr_ntos(&entry->arp_pa, (struct sockaddr *)&sin); sin.sin_port = htons(666); if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (-1); if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { close(fd); return (-1); } write(fd, NULL, 0); close(fd); } #endif return (0); } int arp_delete(arp_t *a, const struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); if (ioctl(a->fd, SIOCDARP, &ar) < 0) return (-1); return (0); } int arp_get(arp_t *a, struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); #ifdef HAVE_ARPREQ_ARP_DEV if (intf_loop(a->intf, _arp_set_dev, &ar) != 1) { errno = ESRCH; return (-1); } #endif if (ioctl(a->fd, SIOCGARP, &ar) < 0) return (-1); if ((ar.arp_flags & ATF_COM) == 0) { errno = ESRCH; return (-1); } return (addr_ston(&ar.arp_ha, &entry->arp_ha)); } #ifdef HAVE_LINUX_PROCFS int arp_loop(arp_t *a, arp_handler callback, void *arg) { FILE *fp; struct arp_entry entry; char buf[BUFSIZ], ipbuf[100], macbuf[100], maskbuf[100], devbuf[100]; int i, type, flags, ret; if ((fp = fopen(PROC_ARP_FILE, "r")) == NULL) return (-1); ret = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { i = sscanf(buf, "%s 0x%x 0x%x %100s %100s %100s\n", ipbuf, &type, &flags, macbuf, maskbuf, devbuf); if (i < 4 || (flags & ATF_COM) == 0) continue; if (addr_aton(ipbuf, &entry.arp_pa) == 0 && addr_aton(macbuf, &entry.arp_ha) == 0) { if ((ret = callback(&entry, arg)) != 0) break; } } if (ferror(fp)) { fclose(fp); return (-1); } fclose(fp); return (ret); } #elif defined (HAVE_STREAMS_MIB2) int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct arp_entry entry; struct strbuf msg; struct T_optmgmt_req *tor; struct T_optmgmt_ack *toa; struct T_error_ack *tea; struct opthdr *opt; mib2_ipNetToMediaEntry_t *arp, *arpend; u_char buf[8192]; int flags, rc, atable, ret; tor = (struct T_optmgmt_req *)buf; toa = (struct T_optmgmt_ack *)buf; tea = (struct T_error_ack *)buf; tor->PRIM_type = T_OPTMGMT_REQ; tor->OPT_offset = sizeof(*tor); tor->OPT_length = sizeof(*opt); tor->MGMT_flags = T_CURRENT; opt = (struct opthdr *)(tor + 1); opt->level = MIB2_IP; opt->name = opt->len = 0; msg.maxlen = sizeof(buf); msg.len = sizeof(*tor) + sizeof(*opt); msg.buf = buf; if (putmsg(r->fd, &msg, NULL, 0) < 0) return (-1); opt = (struct opthdr *)(toa + 1); msg.maxlen = sizeof(buf); for (;;) { flags = 0; if ((rc = getmsg(r->fd, &msg, NULL, &flags)) < 0) return (-1); /* See if we're finished. */ if (rc == 0 && msg.len >= sizeof(*toa) && toa->PRIM_type == T_OPTMGMT_ACK && toa->MGMT_flags == T_SUCCESS && opt->len == 0) break; if (msg.len >= sizeof(*tea) && tea->PRIM_type == T_ERROR_ACK) return (-1); if (rc != MOREDATA || msg.len < (int)sizeof(*toa) || toa->PRIM_type != T_OPTMGMT_ACK || toa->MGMT_flags != T_SUCCESS) return (-1); atable = (opt->level == MIB2_IP && opt->name == MIB2_IP_22); msg.maxlen = sizeof(buf) - (sizeof(buf) % sizeof(*arp)); msg.len = 0; flags = 0; do { rc = getmsg(r->fd, NULL, &msg, &flags); if (rc != 0 && rc != MOREDATA) return (-1); if (!atable) continue; arp = (mib2_ipNetToMediaEntry_t *)msg.buf; arpend = (mib2_ipNetToMediaEntry_t *) (msg.buf + msg.len); entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; for ( ; arp < arpend; arp++) { entry.arp_pa.addr_ip = arp->ipNetToMediaNetAddress; memcpy(&entry.arp_ha.addr_eth, arp->ipNetToMediaPhysAddress.o_bytes, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) return (ret); } } while (rc == MOREDATA); } return (0); } #elif defined(HAVE_SYS_MIB_H) #define MAX_ARPENTRIES 512 /* XXX */ int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct nmparms nm; struct arp_entry entry; mib_ipNetToMediaEnt arpentries[MAX_ARPENTRIES]; int fd, i, n, ret; if ((fd = open_mib("/dev/ip", O_RDWR, 0 /* XXX */, 0)) < 0) return (-1); nm.objid = ID_ipNetToMediaTable; nm.buffer = arpentries; n = sizeof(arpentries); nm.len = &n; if (get_mib_info(fd, &nm) < 0) { close_mib(fd); return (-1); } close_mib(fd); entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; n /= sizeof(*arpentries); ret = 0; for (i = 0; i < n; i++) { if (arpentries[i].Type == INTM_INVALID || arpentries[i].PhysAddr.o_length != ETH_ADDR_LEN) continue; entry.arp_pa.addr_ip = arpentries[i].NetAddr; memcpy(&entry.arp_ha.addr_eth, arpentries[i].PhysAddr.o_bytes, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) break; } return (ret); } #elif defined(HAVE_NET_RADIX_H) /* XXX - Tru64, others? */ #include #include static int _kread(int fd, void *addr, void *buf, int len) { if (lseek(fd, (off_t)addr, SEEK_SET) == (off_t)-1L) return (-1); return (read(fd, buf, len) == len ? 0 : -1); } static int _radix_walk(int fd, struct radix_node *rn, arp_handler callback, void *arg) { struct radix_node rnode; struct rtentry rt; struct sockaddr_in sin; struct arptab at; struct arp_entry entry; int ret = 0; again: _kread(fd, rn, &rnode, sizeof(rnode)); if (rnode.rn_b < 0) { if (!(rnode.rn_flags & RNF_ROOT)) { _kread(fd, rn, &rt, sizeof(rt)); _kread(fd, rt_key(&rt), &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.arp_pa); _kread(fd, rt.rt_llinfo, &at, sizeof(at)); if (at.at_flags & ATF_COM) { addr_pack(&entry.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS, at.at_hwaddr, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) return (ret); } } if ((rn = rnode.rn_dupedkey)) goto again; } else { rn = rnode.rn_r; if ((ret = _radix_walk(fd, rnode.rn_l, callback, arg)) != 0) return (ret); if ((ret = _radix_walk(fd, rn, callback, arg)) != 0) return (ret); } return (ret); } int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct ifnet *ifp, ifnet; struct ifnet_arp_cache_head ifarp; struct radix_node_head *head; struct nlist nl[2]; int fd, ret = 0; memset(nl, 0, sizeof(nl)); nl[0].n_name = "ifnet"; if (knlist(nl) < 0 || nl[0].n_type == 0 || (fd = open("/dev/kmem", O_RDONLY, 0)) < 0) return (-1); for (ifp = (struct ifnet *)nl[0].n_value; ifp != NULL; ifp = ifnet.if_next) { _kread(fd, ifp, &ifnet, sizeof(ifnet)); if (ifnet.if_arp_cache_head != NULL) { _kread(fd, ifnet.if_arp_cache_head, &ifarp, sizeof(ifarp)); /* XXX - only ever one rnh, only ever AF_INET. */ if ((ret = _radix_walk(fd, ifarp.arp_cache_head.rnh_treetop, callback, arg)) != 0) break; } } close(fd); return (ret); } #else int arp_loop(arp_t *a, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif arp_t * arp_close(arp_t *a) { if (a != NULL) { if (a->fd >= 0) close(a->fd); #ifdef HAVE_ARPREQ_ARP_DEV if (a->intf != NULL) intf_close(a->intf); #endif free(a); } return (NULL); } libdnet-1.12/src/arp-none.c0000644000076500007650000000132207426663775016724 0ustar dugsongdugsong00000000000000/* * arp-none.c * * Copyright (c) 2000 Dug Song * * $Id: arp-none.c 252 2002-02-02 04:15:57Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" arp_t * arp_open(void) { errno = ENOSYS; return (NULL); } int arp_add(arp_t *a, const struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_delete(arp_t *a, const struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_get(arp_t *a, struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_loop(arp_t *a, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } arp_t * arp_close(arp_t *a) { return (NULL); } libdnet-1.12/src/arp-win32.c0000644000076500007650000000534710174652026016717 0ustar dugsongdugsong00000000000000/* * arp-win32.c * * Copyright (c) 2002 Dug Song * * $Id: arp-win32.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" struct arp_handle { MIB_IPNETTABLE *iptable; }; arp_t * arp_open(void) { return (calloc(1, sizeof(arp_t))); } int arp_add(arp_t *arp, const struct arp_entry *entry) { MIB_IPFORWARDROW ipfrow; MIB_IPNETROW iprow; if (GetBestRoute(entry->arp_pa.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); iprow.dwIndex = ipfrow.dwForwardIfIndex; iprow.dwPhysAddrLen = ETH_ADDR_LEN; memcpy(iprow.bPhysAddr, &entry->arp_ha.addr_eth, ETH_ADDR_LEN); iprow.dwAddr = entry->arp_pa.addr_ip; iprow.dwType = 4; /* XXX - static */ if (CreateIpNetEntry(&iprow) != NO_ERROR) return (-1); return (0); } int arp_delete(arp_t *arp, const struct arp_entry *entry) { MIB_IPFORWARDROW ipfrow; MIB_IPNETROW iprow; if (GetBestRoute(entry->arp_pa.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); memset(&iprow, 0, sizeof(iprow)); iprow.dwIndex = ipfrow.dwForwardIfIndex; iprow.dwAddr = entry->arp_pa.addr_ip; if (DeleteIpNetEntry(&iprow) != NO_ERROR) { errno = ENXIO; return (-1); } return (0); } static int _arp_get_entry(const struct arp_entry *entry, void *arg) { struct arp_entry *e = (struct arp_entry *)arg; if (addr_cmp(&entry->arp_pa, &e->arp_pa) == 0) { memcpy(&e->arp_ha, &entry->arp_ha, sizeof(e->arp_ha)); return (1); } return (0); } int arp_get(arp_t *arp, struct arp_entry *entry) { if (arp_loop(arp, _arp_get_entry, entry) != 1) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } return (0); } int arp_loop(arp_t *arp, arp_handler callback, void *arg) { struct arp_entry entry; ULONG len; int i, ret; for (len = sizeof(arp->iptable[0]); ; ) { if (arp->iptable) free(arp->iptable); arp->iptable = malloc(len); ret = GetIpNetTable(arp->iptable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; for (i = 0; i < (int)arp->iptable->dwNumEntries; i++) { if (arp->iptable->table[i].dwPhysAddrLen != ETH_ADDR_LEN) continue; entry.arp_pa.addr_ip = arp->iptable->table[i].dwAddr; memcpy(&entry.arp_ha.addr_eth, arp->iptable->table[i].bPhysAddr, ETH_ADDR_LEN); if ((ret = (*callback)(&entry, arg)) != 0) return (ret); } return (0); } arp_t * arp_close(arp_t *arp) { if (arp != NULL) { if (arp->iptable != NULL) free(arp->iptable); free(arp); } return (NULL); } libdnet-1.12/src/blob.c0000644000076500007650000002066310360234231016100 0ustar dugsongdugsong00000000000000/* * blob.c * * Copyright (c) 2002 Dug Song * * $Id: blob.c 615 2006-01-08 16:06:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" static void *(*bl_malloc)(size_t) = malloc; static void *(*bl_realloc)(void *, size_t) = realloc; static void (*bl_free)(void *) = free; static int bl_size = BUFSIZ; static int fmt_D(int, int, blob_t *, va_list *); static int fmt_H(int, int, blob_t *, va_list *); static int fmt_b(int, int, blob_t *, va_list *); static int fmt_c(int, int, blob_t *, va_list *); static int fmt_d(int, int, blob_t *, va_list *); static int fmt_h(int, int, blob_t *, va_list *); static int fmt_s(int, int, blob_t *, va_list *); static void print_hexl(blob_t *); static blob_fmt_cb blob_ascii_fmt[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_D, NULL, NULL, NULL, fmt_H, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_b, fmt_c, fmt_d, NULL, NULL, NULL, fmt_h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_s, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; struct blob_printer { char *name; void (*print)(blob_t *); } blob_printers[] = { { "hexl", print_hexl }, { NULL, NULL }, }; blob_t * blob_new(void) { blob_t *b; if ((b = bl_malloc(sizeof(*b))) != NULL) { b->off = b->end = 0; b->size = bl_size; if ((b->base = bl_malloc(b->size)) == NULL) { bl_free(b); b = NULL; } } return (b); } static int blob_reserve(blob_t *b, int len) { void *p; int nsize; if (b->size < b->end + len) { if (b->size == 0) return (-1); if ((nsize = b->end + len) > bl_size) nsize = ((nsize / bl_size) + 1) * bl_size; if ((p = bl_realloc(b->base, nsize)) == NULL) return (-1); b->base = p; b->size = nsize; } b->end += len; return (0); } int blob_read(blob_t *b, void *buf, int len) { if (b->end - b->off < len) len = b->end - b->off; memcpy(buf, b->base + b->off, len); b->off += len; return (len); } int blob_write(blob_t *b, const void *buf, int len) { if (b->off + len <= b->end || blob_reserve(b, b->off + len - b->end) == 0) { memcpy(b->base + b->off, (u_char *)buf, len); b->off += len; return (len); } return (-1); } int blob_insert(blob_t *b, const void *buf, int len) { if (blob_reserve(b, len) == 0 && b->size) { if (b->end - b->off > 0) memmove( b->base + b->off + len, b->base + b->off, b->end - b->off); memcpy(b->base + b->off, buf, len); b->off += len; return (len); } return (-1); } int blob_delete(blob_t *b, void *buf, int len) { if (b->off + len <= b->end && b->size) { if (buf != NULL) memcpy(buf, b->base + b->off, len); memmove(b->base + b->off, b->base + b->off + len, b->end - (b->off + len)); b->end -= len; return (len); } return (-1); } static int blob_fmt(blob_t *b, int pack, const char *fmt, va_list *ap) { blob_fmt_cb fmt_cb; char *p; int len; for (p = (char *)fmt; *p != '\0'; p++) { if (*p == '%') { p++; if (isdigit((int)*p)) { len = strtol(p, &p, 10); } else if (*p == '*') { len = va_arg(*ap, int); p++; } else len = 0; if ((fmt_cb = blob_ascii_fmt[(int)*p]) == NULL) return (-1); if ((*fmt_cb)(pack, len, b, ap) < 0) return (-1); } else { if (pack) { if (b->off + 1 < b->end || blob_reserve(b, b->off + 1 - b->end) == 0) b->base[b->off++] = *p; else return (-1); } else { if (b->base[b->off++] != *p) return (-1); } } } return (0); } int blob_pack(blob_t *b, const char *fmt, ...) { va_list ap; va_start(ap, fmt); return (blob_fmt(b, 1, fmt, &ap)); } int blob_unpack(blob_t *b, const char *fmt, ...) { va_list ap; va_start(ap, fmt); return (blob_fmt(b, 0, fmt, &ap)); } int blob_seek(blob_t *b, int off, int whence) { if (whence == SEEK_CUR) off += b->off; else if (whence == SEEK_END) off += b->end; if (off < 0 || off > b->end) return (-1); return ((b->off = off)); } int blob_index(blob_t *b, const void *buf, int len) { int i; for (i = b->off; i <= b->end - len; i++) { if (memcmp(b->base + i, buf, len) == 0) return (i); } return (-1); } int blob_rindex(blob_t *b, const void *buf, int len) { int i; for (i = b->end - len; i >= 0; i--) { if (memcmp(b->base + i, buf, len) == 0) return (i); } return (-1); } int blob_print(blob_t *b, char *style, int len) { struct blob_printer *bp; for (bp = blob_printers; bp->name != NULL; bp++) { if (strcmp(bp->name, style) == 0) bp->print(b); } return (0); } int blob_sprint(blob_t *b, char *style, int len, char *dst, int size) { return (0); } blob_t * blob_free(blob_t *b) { if (b->size) bl_free(b->base); bl_free(b); return (NULL); } int blob_register_alloc(size_t size, void *(bmalloc)(size_t), void (*bfree)(void *), void *(*brealloc)(void *, size_t)) { bl_size = size; if (bmalloc != NULL) bl_malloc = bmalloc; if (bfree != NULL) bl_free = bfree; if (brealloc != NULL) bl_realloc = brealloc; return (0); } int blob_register_pack(char c, blob_fmt_cb fmt_cb) { if (blob_ascii_fmt[(int)c] == NULL) { blob_ascii_fmt[(int)c] = fmt_cb; return (0); } return (-1); } static int fmt_D(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint32_t n = va_arg(*ap, uint32_t); n = htonl(n); if (blob_write(b, &n, sizeof(n)) < 0) return (-1); } else { uint32_t *n = va_arg(*ap, uint32_t *); if (blob_read(b, n, sizeof(*n)) != sizeof(*n)) return (-1); *n = ntohl(*n); } return (0); } static int fmt_H(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint16_t n = va_arg(*ap, int); n = htons(n); if (blob_write(b, &n, sizeof(n)) < 0) return (-1); } else { uint16_t *n = va_arg(*ap, uint16_t *); if (blob_read(b, n, sizeof(*n)) != sizeof(*n)) return (-1); *n = ntohs(*n); } return (0); } static int fmt_b(int pack, int len, blob_t *b, va_list *ap) { void *p = va_arg(*ap, void *); if (len <= 0) return (-1); if (pack) return (blob_write(b, p, len)); else return (blob_read(b, p, len)); } static int fmt_c(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint8_t n = va_arg(*ap, int); return (blob_write(b, &n, sizeof(n))); } else { uint8_t *n = va_arg(*ap, uint8_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_d(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint32_t n = va_arg(*ap, uint32_t); return (blob_write(b, &n, sizeof(n))); } else { uint32_t *n = va_arg(*ap, uint32_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_h(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint16_t n = va_arg(*ap, int); return (blob_write(b, &n, sizeof(n))); } else { uint16_t *n = va_arg(*ap, uint16_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_s(int pack, int len, blob_t *b, va_list *ap) { char *p = va_arg(*ap, char *); char c = '\0'; int i, end; if (pack) { if (len > 0) { if ((c = p[len - 1]) != '\0') p[len - 1] = '\0'; } else len = strlen(p) + 1; if (blob_write(b, p, len) > 0) { if (c != '\0') p[len - 1] = c; return (len); } } else { if (len <= 0) return (-1); if ((end = b->end - b->off) < len) end = len; for (i = 0; i < end; i++) { if ((p[i] = b->base[b->off + i]) == '\0') { b->off += i + 1; return (i); } } } return (-1); } static void print_hexl(blob_t *b) { u_int i, j, jm, len; u_char *p; int c; p = b->base + b->off; len = b->end - b->off; printf("\n"); for (i = 0; i < len; i += 0x10) { printf(" %04x: ", (u_int)(i + b->off)); jm = len - i; jm = jm > 16 ? 16 : jm; for (j = 0; j < jm; j++) { printf((j % 2) ? "%02x " : "%02x", (u_int)p[i + j]); } for (; j < 16; j++) { printf((j % 2) ? " " : " "); } printf(" "); for (j = 0; j < jm; j++) { c = p[i + j]; printf("%c", isprint(c) ? c : '.'); } printf("\n"); } } libdnet-1.12/src/err.c0000644000076500007650000000601410045605717015757 0ustar dugsongdugsong00000000000000/* * err.c * * Adapted from OpenBSD libc *err* *warn* code. * * Copyright (c) 2000 Dug Song * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef _WIN32 #include #endif #include #include #include #include #include void err(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) { (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ": "); } va_end(ap); #ifdef _WIN32 (void)fprintf(stderr, "error %lu\n", GetLastError()); #else (void)fprintf(stderr, "%s\n", strerror(errno)); #endif exit(eval); } void warn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) { (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ": "); } va_end(ap); #ifdef _WIN32 (void)fprintf(stderr, "error %lu\n", GetLastError()); #else (void)fprintf(stderr, "%s\n", strerror(errno)); #endif } void errx(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); va_end(ap); exit(eval); } void warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); va_end(ap); } libdnet-1.12/src/eth-bsd.c0000644000076500007650000000607310370303743016515 0ustar dugsongdugsong00000000000000/* * eth-bsd.c * * Copyright (c) 2001 Dug Song * * $Id: eth-bsd.c 630 2006-02-02 04:17:39Z dugsong $ */ #include "config.h" #include #include #include #include #include #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_ROUTE_RT_MSGHDR) #include #include #include #endif #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; char device[16]; }; eth_t * eth_open(const char *device) { struct ifreq ifr; char file[32]; eth_t *e; int i; if ((e = calloc(1, sizeof(*e))) != NULL) { for (i = 0; i < 128; i++) { snprintf(file, sizeof(file), "/dev/bpf%d", i); e->fd = open(file, O_WRONLY); if (e->fd != -1 || errno != EBUSY) break; } if (e->fd < 0) return (eth_close(e)); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); if (ioctl(e->fd, BIOCSETIF, (char *)&ifr) < 0) return (eth_close(e)); #ifdef BIOCSHDRCMPLT i = 1; if (ioctl(e->fd, BIOCSHDRCMPLT, &i) < 0) return (eth_close(e)); #endif strlcpy(e->device, device, sizeof(e->device)); } return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_ROUTE_RT_MSGHDR) int eth_get(eth_t *e, eth_addr_t *ea) { struct if_msghdr *ifm; struct sockaddr_dl *sdl; struct addr ha; u_char *p, *buf; size_t len; int mib[] = { CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0 }; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } for (p = buf; p < buf + len; p += ifm->ifm_msglen) { ifm = (struct if_msghdr *)p; sdl = (struct sockaddr_dl *)(ifm + 1); if (ifm->ifm_type != RTM_IFINFO || (ifm->ifm_addrs & RTA_IFP) == 0) continue; if (sdl->sdl_family != AF_LINK || sdl->sdl_nlen == 0 || memcmp(sdl->sdl_data, e->device, sdl->sdl_nlen) != 0) continue; if (addr_ston((struct sockaddr *)sdl, &ha) == 0) break; } free(buf); if (p >= buf + len) { errno = ESRCH; return (-1); } memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } #else int eth_get(eth_t *e, eth_addr_t *ea) { errno = ENOSYS; return (-1); } #endif #if defined(SIOCSIFLLADDR) int eth_set(eth_t *e, const eth_addr_t *ea) { struct ifreq ifr; struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, e->device, sizeof(ifr.ifr_name)); addr_ntos(&ha, &ifr.ifr_addr); return (ioctl(e->fd, SIOCSIFLLADDR, &ifr)); } #else int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } #endif libdnet-1.12/src/eth-dlpi.c0000644000076500007650000001406110202710144016660 0ustar dugsongdugsong00000000000000/* * eth-dlpi.c * * Based on Neal Nuckolls' 1992 "How to Use DLPI" paper. * * Copyright (c) 2001 Dug Song * * $Id: eth-dlpi.c 560 2005-02-10 16:48:36Z dugsong $ */ #include "config.h" #include #ifdef HAVE_SYS_BUFMOD_H #include #endif #ifdef HAVE_SYS_DLPI_H #include #elif defined(HAVE_SYS_DLPIHDR_H) #include #endif #ifdef HAVE_SYS_DLPI_EXT_H #include #endif #include #include #include #include #include #include #include #include #include #include "dnet.h" #ifndef INFTIM #define INFTIM -1 #endif struct eth_handle { int fd; int sap_len; }; static int dlpi_msg(int fd, union DL_primitives *dlp, int rlen, int flags, int ack, int alen, int size) { struct strbuf ctl; ctl.maxlen = 0; ctl.len = rlen; ctl.buf = (caddr_t)dlp; if (putmsg(fd, &ctl, NULL, flags) < 0) return (-1); ctl.maxlen = size; ctl.len = 0; flags = 0; if (getmsg(fd, &ctl, NULL, &flags) < 0) return (-1); if (dlp->dl_primitive != ack || ctl.len < alen) return (-1); return (0); } #if defined(DLIOCRAW) || defined(HAVE_SYS_DLPIHDR_H) static int strioctl(int fd, int cmd, int len, char *dp) { struct strioctl str; str.ic_cmd = cmd; str.ic_timout = INFTIM; str.ic_len = len; str.ic_dp = dp; if (ioctl(fd, I_STR, &str) < 0) return (-1); return (str.ic_len); } #endif #ifdef HAVE_SYS_DLPIHDR_H /* XXX - OSF1 is nuts */ #define ND_GET ('N' << 8 + 0) static int eth_match_ppa(eth_t *e, const char *device) { char *p, dev[16], buf[256]; int len, ppa; strlcpy(buf, "dl_ifnames", sizeof(buf)); if ((len = strioctl(e->fd, ND_GET, sizeof(buf), buf)) < 0) return (-1); for (p = buf; p < buf + len; p += strlen(p) + 1) { ppa = -1; if (sscanf(p, "%s (PPA %d)\n", dev, &ppa) != 2) break; if (strcmp(dev, device) == 0) break; } return (ppa); } #endif eth_t * eth_open(const char *device) { union DL_primitives *dlp; uint32_t buf[8192]; char *p, dev[16]; eth_t *e; int ppa; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); #ifdef HAVE_SYS_DLPIHDR_H if ((e->fd = open("/dev/streams/dlb", O_RDWR)) < 0) return (eth_close(e)); if ((ppa = eth_match_ppa(e, device)) < 0) { errno = ESRCH; return (eth_close(e)); } #else e->fd = -1; snprintf(dev, sizeof(dev), "/dev/%s", device); if ((p = strpbrk(dev, "0123456789")) == NULL) { errno = EINVAL; return (eth_close(e)); } ppa = atoi(p); *p = '\0'; if ((e->fd = open(dev, O_RDWR)) < 0) { snprintf(dev, sizeof(dev), "/dev/%s", device); if ((e->fd = open(dev, O_RDWR)) < 0) return (eth_close(e)); } #endif dlp = (union DL_primitives *)buf; dlp->info_req.dl_primitive = DL_INFO_REQ; if (dlpi_msg(e->fd, dlp, DL_INFO_REQ_SIZE, RS_HIPRI, DL_INFO_ACK, DL_INFO_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); e->sap_len = dlp->info_ack.dl_sap_length; if (dlp->info_ack.dl_provider_style == DL_STYLE2) { dlp->attach_req.dl_primitive = DL_ATTACH_REQ; dlp->attach_req.dl_ppa = ppa; if (dlpi_msg(e->fd, dlp, DL_ATTACH_REQ_SIZE, 0, DL_OK_ACK, DL_OK_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); } memset(&dlp->bind_req, 0, DL_BIND_REQ_SIZE); dlp->bind_req.dl_primitive = DL_BIND_REQ; #ifdef DL_HP_RAWDLS dlp->bind_req.dl_sap = 24; /* from HP-UX DLPI programmers guide */ dlp->bind_req.dl_service_mode = DL_HP_RAWDLS; #else dlp->bind_req.dl_sap = DL_ETHER; dlp->bind_req.dl_service_mode = DL_CLDLS; #endif if (dlpi_msg(e->fd, dlp, DL_BIND_REQ_SIZE, 0, DL_BIND_ACK, DL_BIND_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); #ifdef DLIOCRAW if (strioctl(e->fd, DLIOCRAW, 0, NULL) < 0) return (eth_close(e)); #endif return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { #if defined(DLIOCRAW) return (write(e->fd, buf, len)); #else union DL_primitives *dlp; struct strbuf ctl, data; struct eth_hdr *eth; uint32_t ctlbuf[8192]; u_char sap[4] = { 0, 0, 0, 0 }; int dlen; dlp = (union DL_primitives *)ctlbuf; #ifdef DL_HP_RAWDATA_REQ dlp->dl_primitive = DL_HP_RAWDATA_REQ; dlen = DL_HP_RAWDATA_REQ_SIZE; #else dlp->unitdata_req.dl_primitive = DL_UNITDATA_REQ; dlp->unitdata_req.dl_dest_addr_length = ETH_ADDR_LEN; dlp->unitdata_req.dl_dest_addr_offset = DL_UNITDATA_REQ_SIZE; dlp->unitdata_req.dl_priority.dl_min = dlp->unitdata_req.dl_priority.dl_max = 0; dlen = DL_UNITDATA_REQ_SIZE; #endif eth = (struct eth_hdr *)buf; *(uint16_t *)sap = ntohs(eth->eth_type); /* XXX - DLSAP setup logic from ISC DHCP */ ctl.maxlen = 0; ctl.len = dlen + ETH_ADDR_LEN + abs(e->sap_len); ctl.buf = (char *)ctlbuf; if (e->sap_len >= 0) { memcpy(ctlbuf + dlen, sap, e->sap_len); memcpy(ctlbuf + dlen + e->sap_len, eth->eth_dst.data, ETH_ADDR_LEN); } else { memcpy(ctlbuf + dlen, eth->eth_dst.data, ETH_ADDR_LEN); memcpy(ctlbuf + dlen + ETH_ADDR_LEN, sap, abs(e->sap_len)); } data.maxlen = 0; data.len = len; data.buf = (char *)buf; if (putmsg(e->fd, &ctl, &data, 0) < 0) return (-1); return (len); #endif } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { union DL_primitives *dlp; u_char buf[2048]; dlp = (union DL_primitives *)buf; dlp->physaddr_req.dl_primitive = DL_PHYS_ADDR_REQ; dlp->physaddr_req.dl_addr_type = DL_CURR_PHYS_ADDR; if (dlpi_msg(e->fd, dlp, DL_PHYS_ADDR_REQ_SIZE, 0, DL_PHYS_ADDR_ACK, DL_PHYS_ADDR_ACK_SIZE, sizeof(buf)) < 0) return (-1); memcpy(ea, buf + dlp->physaddr_ack.dl_addr_offset, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { union DL_primitives *dlp; u_char buf[2048]; dlp = (union DL_primitives *)buf; dlp->set_physaddr_req.dl_primitive = DL_SET_PHYS_ADDR_REQ; dlp->set_physaddr_req.dl_addr_length = ETH_ADDR_LEN; dlp->set_physaddr_req.dl_addr_offset = DL_SET_PHYS_ADDR_REQ_SIZE; memcpy(buf + DL_SET_PHYS_ADDR_REQ_SIZE, ea, sizeof(*ea)); return (dlpi_msg(e->fd, dlp, DL_SET_PHYS_ADDR_REQ_SIZE + ETH_ADDR_LEN, 0, DL_OK_ACK, DL_OK_ACK_SIZE, sizeof(buf))); } libdnet-1.12/src/eth-linux.c0000644000076500007650000000413110175535200017073 0ustar dugsongdugsong00000000000000/* * eth-linux.c * * Copyright (c) 2000 Dug Song * * $Id: eth-linux.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 #include #include #else #include #include #include #endif /* __GLIBC__ */ #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; struct ifreq ifr; struct sockaddr_ll sll; }; eth_t * eth_open(const char *device) { eth_t *e; int n; if ((e = calloc(1, sizeof(*e))) != NULL) { if ((e->fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) return (eth_close(e)); #ifdef SO_BROADCAST n = 1; if (setsockopt(e->fd, SOL_SOCKET, SO_BROADCAST, &n, sizeof(n)) < 0) return (eth_close(e)); #endif strlcpy(e->ifr.ifr_name, device, sizeof(e->ifr.ifr_name)); if (ioctl(e->fd, SIOCGIFINDEX, &e->ifr) < 0) return (eth_close(e)); e->sll.sll_family = AF_PACKET; e->sll.sll_ifindex = e->ifr.ifr_ifindex; } return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { struct eth_hdr *eth = (struct eth_hdr *)buf; e->sll.sll_protocol = eth->eth_type; return (sendto(e->fd, buf, len, 0, (struct sockaddr *)&e->sll, sizeof(e->sll))); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { struct addr ha; if (ioctl(e->fd, SIOCGIFHWADDR, &e->ifr) < 0) return (-1); if (addr_ston(&e->ifr.ifr_hwaddr, &ha) < 0) return (-1); memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); addr_ntos(&ha, &e->ifr.ifr_hwaddr); return (ioctl(e->fd, SIOCSIFHWADDR, &e->ifr)); } libdnet-1.12/src/eth-ndd.c0000644000076500007650000000412610175535200016505 0ustar dugsongdugsong00000000000000/* * eth-ndd.c * * Copyright (c) 2001 Dug Song * * $Id: eth-ndd.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { char device[16]; int fd; }; eth_t * eth_open(const char *device) { struct sockaddr_ndd_8022 sa; eth_t *e; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); if ((e->fd = socket(AF_NDD, SOCK_DGRAM, NDD_PROT_ETHER)) < 0) return (eth_close(e)); sa.sndd_8022_family = AF_NDD; sa.sndd_8022_len = sizeof(sa); sa.sndd_8022_filtertype = NS_ETHERTYPE; sa.sndd_8022_ethertype = ETH_TYPE_IP; sa.sndd_8022_filterlen = sizeof(struct ns_8022); strlcpy(sa.sndd_8022_nddname, device, sizeof(sa.sndd_8022_nddname)); if (bind(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) return (eth_close(e)); if (connect(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) return (eth_close(e)); /* XXX - SO_BROADCAST needed? */ return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { struct kinfo_ndd *nddp; int size; void *end; if ((size = getkerninfo(KINFO_NDD, 0, 0, 0)) == 0) { errno = ENOENT; return (-1); } else if (size < 0) return (-1); if ((nddp = malloc(size)) == NULL) return (-1); if (getkerninfo(KINFO_NDD, nddp, &size, 0) < 0) { free(nddp); return (-1); } for (end = (void *)nddp + size; (void *)nddp < end; nddp++) { if (strcmp(nddp->ndd_alias, e->device) == 0 || strcmp(nddp->ndd_name, e->device) == 0) { memcpy(ea, nddp->ndd_addr, sizeof(*ea)); } } free(nddp); if ((void *)nddp >= end) { errno = ESRCH; return (-1); } return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } libdnet-1.12/src/eth-none.c0000644000076500007650000000116210175535200016674 0ustar dugsongdugsong00000000000000/* * eth-none.c * * Copyright (c) 2000 Dug Song * * $Id: eth-none.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" eth_t * eth_open(const char *device) { errno = ENOSYS; return (NULL); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { errno = ENOSYS; return (-1); } eth_t * eth_close(eth_t *e) { return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { errno = ENOSYS; return (-1); } int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } libdnet-1.12/src/eth-pfilt.c0000644000076500007650000000276610202712234017061 0ustar dugsongdugsong00000000000000/* * eth-pfilt.c * * XXX - requires 'cd dev && ./MAKEDEV pfilt' if not already configured... * * Copyright (c) 2001 Dug Song * * $Id: eth-pfilt.c 563 2005-02-10 17:06:36Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; int sock; char device[16]; }; eth_t * eth_open(const char *device) { struct eth_handle *e; int fd; if ((e = calloc(1, sizeof(*e))) != NULL) { strlcpy(e->device, device, sizeof(e->device)); if ((e->fd = pfopen(e->device, O_WRONLY)) < 0 || (e->sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) e = eth_close(e); } return (e); } int eth_get(eth_t *e, eth_addr_t *ea) { struct ifdevea ifd; strlcpy(ifd.ifr_name, e->device, sizeof(ifd.ifr_name)); if (ioctl(e->sock, SIOCRPHYSADDR, &ifd) < 0) return (-1); memcpy(ea, ifd.current_pa, ETH_ADDR_LEN); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct ifdevea ifd; strlcpy(ifd.ifr_name, e->device, sizeof(ifd.ifr_name)); memcpy(ifd.current_pa, ea, ETH_ADDR_LEN); return (ioctl(e->sock, SIOCSPHYSADDR, &ifd)); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); if (e->sock >= 0) close(e->sock); free(e); } return (NULL); } libdnet-1.12/src/eth-snoop.c0000644000076500007650000000345110177074125017104 0ustar dugsongdugsong00000000000000/* * eth-snoop.c * * Copyright (c) 2000 Dug Song * * $Id: eth-snoop.c 548 2005-01-30 06:01:57Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; struct ifreq ifr; }; eth_t * eth_open(const char *device) { struct sockaddr_raw sr; eth_t *e; int n; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); if ((e->fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_SNOOP)) < 0) return (eth_close(e)); memset(&sr, 0, sizeof(sr)); sr.sr_family = AF_RAW; strlcpy(sr.sr_ifname, device, sizeof(sr.sr_ifname)); if (bind(e->fd, (struct sockaddr *)&sr, sizeof(sr)) < 0) return (eth_close(e)); n = 60000; if (setsockopt(e->fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) < 0) return (eth_close(e)); strlcpy(e->ifr.ifr_name, device, sizeof(e->ifr.ifr_name)); return (e); } int eth_get(eth_t *e, eth_addr_t *ea) { struct addr ha; if (ioctl(e->fd, SIOCGIFADDR, &e->ifr) < 0) return (-1); if (addr_ston(&e->ifr.ifr_addr, &ha) < 0) return (-1); if (ha.addr_type != ADDR_TYPE_ETH) { errno = EINVAL; return (-1); } memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); if (addr_ntos(&ha, &e->ifr.ifr_addr) < 0) return (-1); return (ioctl(e->fd, SIOCSIFADDR, &e->ifr)); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } libdnet-1.12/src/eth-win32.c0000644000076500007650000000521610315660441016705 0ustar dugsongdugsong00000000000000/* * eth-win32.c * * Copyright (c) 2000 Dug Song * * $Id: eth-win32.c 613 2005-09-26 02:46:57Z dugsong $ */ #include "config.h" /* XXX - VC++ 6.0 bogosity */ #define sockaddr_storage sockaddr #include #undef sockaddr_storage #include #include #include #include "dnet.h" struct eth_handle { LPADAPTER lpa; LPPACKET pkt; }; eth_t * eth_open(const char *device) { eth_t *eth; intf_t *intf; struct intf_entry ifent; eth_addr_t ea; char *p, *buf; ULONG len; /* Get interface entry. */ memset(&ifent, 0, sizeof(ifent)); if ((intf = intf_open()) != NULL) { strlcpy(ifent.intf_name, device, sizeof(ifent.intf_name)); intf_get(intf, &ifent); intf_close(intf); } if (ifent.intf_link_addr.addr_type != ADDR_TYPE_ETH) return (NULL); /* Get Packet driver adapter name/desc lists. */ buf = NULL; PacketGetAdapterNames(buf, &len); if (len > 0 && (buf = malloc(len)) != NULL) { if (!PacketGetAdapterNames(buf, &len)) { free(buf); buf = NULL; } } if (buf == NULL) return (NULL); /* XXX - find adapter with matching interface MAC address. */ if ((eth = calloc(1, sizeof(*eth))) == NULL) { free(buf); return (NULL); } for (p = buf; *p != '\0'; p += strlen(p) + 1) { if ((eth->lpa = PacketOpenAdapter(p)) != NULL) { if (eth->lpa->hFile != INVALID_HANDLE_VALUE && eth_get(eth, &ea) == 0 && memcmp(&ea, &ifent.intf_link_addr.addr_eth, ETH_ADDR_LEN) == 0) { PacketSetBuff(eth->lpa, 512000); eth->pkt = PacketAllocatePacket(); break; } PacketCloseAdapter(eth->lpa); } } free(buf); if (eth->pkt == NULL) eth = eth_close(eth); return (eth); } ssize_t eth_send(eth_t *eth, const void *buf, size_t len) { PacketInitPacket(eth->pkt, (void *)buf, len); PacketSendPacket(eth->lpa, eth->pkt, TRUE); return (len); } eth_t * eth_close(eth_t *eth) { if (eth != NULL) { if (eth->pkt != NULL) PacketFreePacket(eth->pkt); if (eth->lpa != NULL) PacketCloseAdapter(eth->lpa); free(eth); } return (NULL); } int eth_get(eth_t *eth, eth_addr_t *ea) { PACKET_OID_DATA *data; u_char buf[512]; data = (PACKET_OID_DATA *)buf; data->Oid = OID_802_3_CURRENT_ADDRESS; data->Length = ETH_ADDR_LEN; if (PacketRequest(eth->lpa, FALSE, data) == TRUE) { memcpy(ea, data->Data, ETH_ADDR_LEN); return (0); } return (-1); } int eth_set(eth_t *eth, const eth_addr_t *ea) { PACKET_OID_DATA *data; u_char buf[512]; data = (PACKET_OID_DATA *)buf; data->Oid = OID_802_3_CURRENT_ADDRESS; memcpy(data->Data, ea, ETH_ADDR_LEN); data->Length = ETH_ADDR_LEN; if (PacketRequest(eth->lpa, TRUE, data) == TRUE) return (0); return (-1); } libdnet-1.12/src/fw-ipchains.c0000644000076500007650000001316310046255700017374 0ustar dugsongdugsong00000000000000/* * fw-ipchains.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipchains.c 507 2004-05-05 21:25:20Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #undef __USE_BSD #include #include #ifdef HAVE_LINUX_IP_FW_H #include #elif defined(HAVE_LINUX_IP_FWCHAINS_H) #include #elif defined(HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H) #include #endif #include #include #include #include #include #include #include "dnet.h" #define PROC_IPCHAINS_FILE "/proc/net/ip_fwchains" struct fw_handle { int fd; }; static void fr_to_fwc(const struct fw_rule *fr, struct ip_fwchange *fwc) { memset(fwc, 0, sizeof(*fwc)); strlcpy(fwc->fwc_rule.ipfw.fw_vianame, fr->fw_device, IFNAMSIZ); if (fr->fw_op == FW_OP_ALLOW) strlcpy(fwc->fwc_rule.label, IP_FW_LABEL_ACCEPT, sizeof(fwc->fwc_rule.label)); else strlcpy(fwc->fwc_rule.label, IP_FW_LABEL_BLOCK, sizeof(fwc->fwc_rule.label)); if (fr->fw_dir == FW_DIR_IN) strlcpy(fwc->fwc_label, IP_FW_LABEL_INPUT, sizeof(fwc->fwc_label)); else strlcpy(fwc->fwc_label, IP_FW_LABEL_OUTPUT, sizeof(fwc->fwc_label)); fwc->fwc_rule.ipfw.fw_proto = fr->fw_proto; fwc->fwc_rule.ipfw.fw_src.s_addr = fr->fw_src.addr_ip; fwc->fwc_rule.ipfw.fw_dst.s_addr = fr->fw_dst.addr_ip; addr_btom(fr->fw_src.addr_bits, &fwc->fwc_rule.ipfw.fw_smsk.s_addr, IP_ADDR_LEN); addr_btom(fr->fw_dst.addr_bits, &fwc->fwc_rule.ipfw.fw_dmsk.s_addr, IP_ADDR_LEN); /* XXX - ICMP? */ fwc->fwc_rule.ipfw.fw_spts[0] = fr->fw_sport[0]; fwc->fwc_rule.ipfw.fw_spts[1] = fr->fw_sport[1]; fwc->fwc_rule.ipfw.fw_dpts[0] = fr->fw_dport[0]; fwc->fwc_rule.ipfw.fw_dpts[1] = fr->fw_dport[1]; } static void fwc_to_fr(const struct ip_fwchange *fwc, struct fw_rule *fr) { memset(fr, 0, sizeof(*fr)); strlcpy(fr->fw_device, fwc->fwc_rule.ipfw.fw_vianame, sizeof(fr->fw_device)); if (strcmp(fwc->fwc_rule.label, IP_FW_LABEL_ACCEPT) == 0) fr->fw_op = FW_OP_ALLOW; else fr->fw_op = FW_OP_BLOCK; if (strcmp(fwc->fwc_label, IP_FW_LABEL_INPUT) == 0) fr->fw_dir = FW_DIR_IN; else fr->fw_dir = FW_DIR_OUT; fr->fw_proto = fwc->fwc_rule.ipfw.fw_proto; fr->fw_src.addr_type = fr->fw_dst.addr_type = ADDR_TYPE_IP; fr->fw_src.addr_ip = fwc->fwc_rule.ipfw.fw_src.s_addr; fr->fw_dst.addr_ip = fwc->fwc_rule.ipfw.fw_dst.s_addr; addr_mtob(&fwc->fwc_rule.ipfw.fw_smsk.s_addr, IP_ADDR_LEN, &fr->fw_src.addr_bits); addr_mtob(&fwc->fwc_rule.ipfw.fw_dmsk.s_addr, IP_ADDR_LEN, &fr->fw_dst.addr_bits); /* XXX - ICMP? */ fr->fw_sport[0] = fwc->fwc_rule.ipfw.fw_spts[0]; fr->fw_sport[1] = fwc->fwc_rule.ipfw.fw_spts[1]; fr->fw_dport[0] = fwc->fwc_rule.ipfw.fw_dpts[0]; fr->fw_dport[1] = fwc->fwc_rule.ipfw.fw_dpts[1]; } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct ip_fwchange fwc; fr_to_fwc(rule, &fwc); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_APPEND, &fwc, sizeof(fwc))); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct ip_fwchange fwc; fr_to_fwc(rule, &fwc); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_DELETE, &fwc, sizeof(fwc))); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { FILE *fp; struct ip_fwchange fwc; struct fw_rule fr; char buf[BUFSIZ]; u_int phi, plo, bhi, blo, tand, txor; int ret; if ((fp = fopen(PROC_IPCHAINS_FILE, "r")) == NULL) return (-1); while (fgets(buf, sizeof(buf), fp) != NULL) { if (sscanf(buf, "%8s %X/%X->%X/%X %s %hX %hX %hu %u %u %u %u " "%hu-%hu %hu-%hu A%X X%X %hX %u %hu %s\n", fwc.fwc_label, &fwc.fwc_rule.ipfw.fw_src.s_addr, &fwc.fwc_rule.ipfw.fw_smsk.s_addr, &fwc.fwc_rule.ipfw.fw_dst.s_addr, &fwc.fwc_rule.ipfw.fw_dmsk.s_addr, fwc.fwc_rule.ipfw.fw_vianame, &fwc.fwc_rule.ipfw.fw_flg, &fwc.fwc_rule.ipfw.fw_invflg, &fwc.fwc_rule.ipfw.fw_proto, &phi, &plo, &bhi, &blo, &fwc.fwc_rule.ipfw.fw_spts[0], &fwc.fwc_rule.ipfw.fw_spts[1], &fwc.fwc_rule.ipfw.fw_dpts[0], &fwc.fwc_rule.ipfw.fw_dpts[1], &tand, &txor, &fwc.fwc_rule.ipfw.fw_redirpt, &fwc.fwc_rule.ipfw.fw_mark, &fwc.fwc_rule.ipfw.fw_outputsize, fwc.fwc_rule.label) != 23) break; if (strcmp(fwc.fwc_rule.label, IP_FW_LABEL_ACCEPT) != 0 && strcmp(fwc.fwc_rule.label, IP_FW_LABEL_BLOCK) != 0 && strcmp(fwc.fwc_rule.label, IP_FW_LABEL_REJECT) != 0) continue; if (strcmp(fwc.fwc_label, IP_FW_LABEL_INPUT) != 0 && strcmp(fwc.fwc_label, IP_FW_LABEL_OUTPUT) != 0) continue; if (strcmp(fwc.fwc_rule.label, "-") == 0) (fwc.fwc_rule.label)[0] = '\0'; if (strcmp(fwc.fwc_rule.ipfw.fw_vianame, "-") == 0) (fwc.fwc_rule.ipfw.fw_vianame)[0] = '\0'; fwc.fwc_rule.ipfw.fw_src.s_addr = htonl(fwc.fwc_rule.ipfw.fw_src.s_addr); fwc.fwc_rule.ipfw.fw_dst.s_addr = htonl(fwc.fwc_rule.ipfw.fw_dst.s_addr); fwc.fwc_rule.ipfw.fw_smsk.s_addr = htonl(fwc.fwc_rule.ipfw.fw_smsk.s_addr); fwc.fwc_rule.ipfw.fw_dmsk.s_addr = htonl(fwc.fwc_rule.ipfw.fw_dmsk.s_addr); fwc_to_fr(&fwc, &fr); if ((ret = callback(&fr, arg)) != 0) { fclose(fp); return (ret); } } fclose(fp); return (0); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/src/fw-ipf.c0000644000076500007650000001347210204737135016362 0ustar dugsongdugsong00000000000000 /* * fw-ipf.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipf.c 593 2005-02-16 21:42:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #define _NETINET_IP6_H_ /* XXX */ #include #define ip_t ipf_ip_t #ifdef HAVE_NETINET_IP_FIL_COMPAT_H # include #else # include #endif #include #undef ip_t #include #include #include #include #include #include #include #define KMEM_NAME "/dev/kmem" #include "dnet.h" #if !defined(fi_saddr) && !defined(fi_daddr) # define fi_saddr fi_src.s_addr # define fi_daddr fi_dst.s_addr #endif struct fw_handle { int fd; int kfd; }; static void rule_to_ipf(const struct fw_rule *rule, struct frentry *fr) { memset(fr, 0, sizeof(*fr)); if (*rule->fw_device != '\0') { strlcpy(fr->fr_ifname, rule->fw_device, IFNAMSIZ); strlcpy(fr->fr_oifname, rule->fw_device, IFNAMSIZ); } if (rule->fw_op == FW_OP_ALLOW) fr->fr_flags |= FR_PASS; else fr->fr_flags |= FR_BLOCK; if (rule->fw_dir == FW_DIR_IN) fr->fr_flags |= FR_INQUE; else fr->fr_flags |= FR_OUTQUE; fr->fr_ip.fi_p = rule->fw_proto; fr->fr_ip.fi_saddr = rule->fw_src.addr_ip; fr->fr_ip.fi_daddr = rule->fw_dst.addr_ip; addr_btom(rule->fw_src.addr_bits, &fr->fr_mip.fi_saddr, IP_ADDR_LEN); addr_btom(rule->fw_dst.addr_bits, &fr->fr_mip.fi_daddr, IP_ADDR_LEN); switch (rule->fw_proto) { case IPPROTO_ICMP: fr->fr_icmpm = rule->fw_sport[1] << 8 | (rule->fw_dport[1] & 0xff); fr->fr_icmp = rule->fw_sport[0] << 8 | (rule->fw_dport[0] & 0xff); break; case IPPROTO_TCP: case IPPROTO_UDP: fr->fr_sport = rule->fw_sport[0]; if (rule->fw_sport[0] != rule->fw_sport[1]) { fr->fr_scmp = FR_INRANGE; fr->fr_stop = rule->fw_sport[1]; } else fr->fr_scmp = FR_EQUAL; fr->fr_dport = rule->fw_dport[0]; if (rule->fw_dport[0] != rule->fw_dport[1]) { fr->fr_dcmp = FR_INRANGE; fr->fr_dtop = rule->fw_dport[1]; } else fr->fr_dcmp = FR_EQUAL; break; } } static void ipf_ports_to_rule(uint8_t cmp, uint16_t port, uint16_t top, uint16_t *range) { switch (cmp) { case FR_EQUAL: range[0] = range[1] = port; break; case FR_NEQUAL: range[0] = port - 1; range[1] = port + 1; break; case FR_LESST: range[0] = 0; range[1] = port - 1; break; case FR_GREATERT: range[0] = port + 1; range[1] = TCP_PORT_MAX; break; case FR_LESSTE: range[0] = 0; range[1] = port; break; case FR_GREATERTE: range[0] = port; range[1] = TCP_PORT_MAX; break; case FR_OUTRANGE: range[0] = port; range[1] = top; break; case FR_INRANGE: range[0] = port; range[1] = top; break; default: range[0] = 0; range[1] = TCP_PORT_MAX; } } static void ipf_to_rule(const struct frentry *fr, struct fw_rule *rule) { memset(rule, 0, sizeof(*rule)); strlcpy(rule->fw_device, fr->fr_ifname, sizeof(rule->fw_device)); rule->fw_op = (fr->fr_flags & FR_PASS) ? FW_OP_ALLOW : FW_OP_BLOCK; rule->fw_dir = (fr->fr_flags & FR_INQUE) ? FW_DIR_IN : FW_DIR_OUT; rule->fw_proto = fr->fr_ip.fi_p; rule->fw_src.addr_type = rule->fw_dst.addr_type = ADDR_TYPE_IP; rule->fw_src.addr_ip = fr->fr_ip.fi_saddr; rule->fw_dst.addr_ip = fr->fr_ip.fi_daddr; addr_mtob(&fr->fr_mip.fi_saddr, IP_ADDR_LEN, &rule->fw_src.addr_bits); addr_mtob(&fr->fr_mip.fi_daddr, IP_ADDR_LEN, &rule->fw_dst.addr_bits); switch (rule->fw_proto) { case IPPROTO_ICMP: rule->fw_sport[0] = ntohs(fr->fr_icmp & fr->fr_icmpm) >> 8; rule->fw_sport[1] = ntohs(fr->fr_icmpm) >> 8; rule->fw_dport[0] = ntohs(fr->fr_icmp & fr->fr_icmpm) & 0xff; rule->fw_dport[1] = ntohs(fr->fr_icmpm) & 0xff; break; case IPPROTO_TCP: case IPPROTO_UDP: ipf_ports_to_rule(fr->fr_scmp, fr->fr_sport, fr->fr_stop, rule->fw_sport); ipf_ports_to_rule(fr->fr_dcmp, fr->fr_dport, fr->fr_dtop, rule->fw_dport); break; } } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { fw->fd = fw->kfd = -1; if ((fw->fd = open(IPL_NAME, O_RDWR, 0)) < 0) return (fw_close(fw)); if ((fw->kfd = open(KMEM_NAME, O_RDONLY)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct frentry fr; assert(fw != NULL && rule != NULL); rule_to_ipf(rule, &fr); return (ioctl(fw->fd, SIOCADDFR, &fr)); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct frentry fr; assert(fw != NULL && rule != NULL); rule_to_ipf(rule, &fr); return (ioctl(fw->fd, SIOCDELFR, &fr)); } static int fw_kcopy(fw_t *fw, u_char *buf, off_t pos, size_t n) { int i; if (lseek(fw->kfd, pos, 0) < 0) return (-1); while ((i = read(fw->kfd, buf, n)) < n) { if (i <= 0) return (-1); buf += i; n -= i; } return (0); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct friostat fio; struct friostat *fiop = &fio; struct frentry *frp, fr; struct fw_rule rule; int ret; memset(&fio, 0, sizeof(fio)); #ifdef __OpenBSD__ if (ioctl(fw->fd, SIOCGETFS, fiop) < 0) #else if (ioctl(fw->fd, SIOCGETFS, &fiop) < 0) /* XXX - darren! */ #endif return (-1); for (frp = fio.f_fout[(int)fio.f_active]; frp != NULL; frp = fr.fr_next) { if (fw_kcopy(fw, (u_char *)&fr, (u_long)frp, sizeof(fr)) < 0) return (-1); ipf_to_rule(&fr, &rule); if ((ret = callback(&rule, arg)) != 0) return (ret); } for (frp = fio.f_fin[(int)fio.f_active]; frp != NULL; frp = fr.fr_next) { if (fw_kcopy(fw, (u_char *)&fr, (u_long)frp, sizeof(fr)) < 0) return (-1); ipf_to_rule(&fr, &rule); if ((ret = callback(&rule, arg)) != 0) return (ret); } return (0); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); if (fw->kfd >= 0) close(fw->kfd); free(fw); } return (NULL); } libdnet-1.12/src/fw-ipfw.c0000644000076500007650000001650010001145373016534 0ustar dugsongdugsong00000000000000/* * fw-ipfw.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipfw.c 483 2004-01-14 04:52:11Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct fw_handle { int fd; }; static void fr_to_ipfw_device(const char *device, char *name, short *unit) { char *p; p = strpbrk(device, "0123456789"); *unit = atoi(p); strlcpy(name, device, p - device + 1); } static void fr_to_ipfw(const struct fw_rule *fr, struct ip_fw *ipfw) { int i; memset(ipfw, 0, sizeof(*ipfw)); if (fr->fw_dir == FW_DIR_IN) { if (*fr->fw_device != '\0') { fr_to_ipfw_device(fr->fw_device, ipfw->fw_in_if.fu_via_if.name, &ipfw->fw_in_if.fu_via_if.unit); ipfw->fw_flg |= IP_FW_F_IIFNAME; } ipfw->fw_flg |= IP_FW_F_IN; } else { if (*fr->fw_device != '\0') { fr_to_ipfw_device(fr->fw_device, ipfw->fw_out_if.fu_via_if.name, &ipfw->fw_out_if.fu_via_if.unit); ipfw->fw_flg |= IP_FW_F_OIFNAME; } ipfw->fw_flg |= IP_FW_F_OUT; } if (fr->fw_op == FW_OP_ALLOW) ipfw->fw_flg |= IP_FW_F_ACCEPT; else ipfw->fw_flg |= IP_FW_F_DENY; ipfw->fw_prot = fr->fw_proto; ipfw->fw_src.s_addr = fr->fw_src.addr_ip; ipfw->fw_dst.s_addr = fr->fw_dst.addr_ip; addr_btom(fr->fw_src.addr_bits, &ipfw->fw_smsk.s_addr, IP_ADDR_LEN); addr_btom(fr->fw_dst.addr_bits, &ipfw->fw_dmsk.s_addr, IP_ADDR_LEN); switch (fr->fw_proto) { case IP_PROTO_TCP: case IP_PROTO_UDP: i = 0; if (fr->fw_sport[0] != fr->fw_sport[1]) { ipfw->fw_flg |= IP_FW_F_SRNG; ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[0]; ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[1]; IP_FW_SETNSRCP(ipfw, 2); } else if (fr->fw_sport[0] > 0) { ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[0]; IP_FW_SETNSRCP(ipfw, 1); } if (fr->fw_dport[0] != fr->fw_dport[1]) { ipfw->fw_flg |= IP_FW_F_DRNG; ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[0]; ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[1]; IP_FW_SETNDSTP(ipfw, 2); } else if (fr->fw_dport[0] > 0) { ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[0]; IP_FW_SETNDSTP(ipfw, 1); } break; case IP_PROTO_ICMP: if (fr->fw_sport[1]) { ipfw->fw_uar.fw_icmptypes[fr->fw_sport[0] / 32] |= 1 << (fr->fw_sport[0] % 32); ipfw->fw_flg |= IP_FW_F_ICMPBIT; } /* XXX - no support for ICMP code. */ break; } } static void ipfw_to_fr(const struct ip_fw *ipfw, struct fw_rule *fr) { int i; memset(fr, 0, sizeof(*fr)); if ((ipfw->fw_flg & IP_FW_F_IN) && *ipfw->fw_in_if.fu_via_if.name) snprintf(fr->fw_device, sizeof(fr->fw_device), "%s%d", ipfw->fw_in_if.fu_via_if.name, ipfw->fw_in_if.fu_via_if.unit); else if ((ipfw->fw_flg & IP_FW_F_OUT) && *ipfw->fw_out_if.fu_via_if.name) snprintf(fr->fw_device, sizeof(fr->fw_device), "%s%d", ipfw->fw_out_if.fu_via_if.name, ipfw->fw_out_if.fu_via_if.unit); fr->fw_op = (ipfw->fw_flg & IP_FW_F_ACCEPT) ? FW_OP_ALLOW : FW_OP_BLOCK; fr->fw_dir = (ipfw->fw_flg & IP_FW_F_IN) ? FW_DIR_IN : FW_DIR_OUT; fr->fw_proto = ipfw->fw_prot; fr->fw_src.addr_type = fr->fw_dst.addr_type = ADDR_TYPE_IP; fr->fw_src.addr_ip = ipfw->fw_src.s_addr; fr->fw_dst.addr_ip = ipfw->fw_dst.s_addr; addr_mtob(&ipfw->fw_smsk.s_addr, IP_ADDR_LEN, &fr->fw_src.addr_bits); addr_mtob(&ipfw->fw_dmsk.s_addr, IP_ADDR_LEN, &fr->fw_dst.addr_bits); switch (fr->fw_proto) { case IP_PROTO_TCP: case IP_PROTO_UDP: if ((ipfw->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(ipfw) == 2) { fr->fw_sport[0] = ipfw->fw_uar.fw_pts[0]; fr->fw_sport[1] = ipfw->fw_uar.fw_pts[1]; } else if (IP_FW_GETNSRCP(ipfw) == 1) { fr->fw_sport[0] = fr->fw_sport[1] = ipfw->fw_uar.fw_pts[0]; } else if (IP_FW_GETNSRCP(ipfw) == 0) { fr->fw_sport[0] = 0; fr->fw_sport[1] = TCP_PORT_MAX; } if ((ipfw->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(ipfw) == 2) { i = IP_FW_GETNSRCP(ipfw); fr->fw_dport[0] = ipfw->fw_uar.fw_pts[i]; fr->fw_dport[1] = ipfw->fw_uar.fw_pts[i + 1]; } else if (IP_FW_GETNDSTP(ipfw) == 1) { i = IP_FW_GETNSRCP(ipfw); fr->fw_dport[0] = fr->fw_dport[1] = ipfw->fw_uar.fw_pts[i]; } else if (IP_FW_GETNDSTP(ipfw) == 0) { fr->fw_dport[0] = 0; fr->fw_dport[1] = TCP_PORT_MAX; } break; case IP_PROTO_ICMP: if (ipfw->fw_flg & IP_FW_F_ICMPBIT) { for (i = 0; i < IP_FW_ICMPTYPES_DIM * 32; i++) { if (ipfw->fw_uar.fw_icmptypes[i / 32] & (1U << (i % 32))) { fr->fw_sport[0] = i; fr->fw_sport[1] = 0xff; break; } } } /* XXX - no support for ICMP code. */ break; } } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = socket(AF_INET, SOCK_RAW, IPPROTO_IP)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct ip_fw ipfw; assert(fw != NULL && rule != NULL); fr_to_ipfw(rule, &ipfw); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_ADD, &ipfw, sizeof(ipfw))); } static int fw_cmp(const struct fw_rule *a, const struct fw_rule *b) { if (strcmp(a->fw_device, b->fw_device) != 0 || a->fw_op != b->fw_op || a->fw_dir != b->fw_dir || a->fw_proto != b->fw_proto || addr_cmp(&a->fw_src, &b->fw_src) != 0 || addr_cmp(&a->fw_dst, &b->fw_dst) != 0 || memcmp(a->fw_sport, b->fw_sport, sizeof(a->fw_sport)) != 0 || memcmp(a->fw_dport, b->fw_dport, sizeof(a->fw_dport)) != 0) return (-1); return (0); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct ip_fw *ipfw; struct fw_rule fr; int nbytes, nalloc, ret; u_char *buf, *new; assert(rule != NULL); nbytes = nalloc = sizeof(*ipfw); if ((buf = malloc(nbytes)) == NULL) return (-1); while (nbytes >= nalloc) { nalloc = nalloc * 2 + 200; nbytes = nalloc; if ((new = realloc(buf, nbytes)) == NULL) { if (buf) free(buf); return (-1); } buf = new; if (getsockopt(fw->fd, IPPROTO_IP, IP_FW_GET, buf, &nbytes) < 0) { free(buf); return (-1); } } ret = -1; /* XXX - 65535 is the fixed ipfw default rule. */ for (ipfw = (struct ip_fw *)buf; ipfw->fw_number < 65535; ipfw++) { ipfw_to_fr(ipfw, &fr); if (fw_cmp(&fr, rule) == 0) { if (setsockopt(fw->fd, IPPROTO_IP, IP_FW_DEL, ipfw, sizeof(*ipfw)) < 0) ret = -2; else ret = 0; break; } } free(buf); if (ret < 0) { if (ret == -1) errno = ESRCH; return (-1); } return (0); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct ip_fw *ipfw; struct fw_rule fr; int i, cnt, nbytes, nalloc, ret; u_char *buf, *new; nbytes = nalloc = sizeof(*ipfw); if ((buf = malloc(nbytes)) == NULL) return (-1); while (nbytes >= nalloc) { nalloc = nalloc * 2 + 200; nbytes = nalloc; if ((new = realloc(buf, nbytes)) == NULL) { if (buf) free(buf); return (-1); } buf = new; if (getsockopt(fw->fd, IPPROTO_IP, IP_FW_GET, buf, &nbytes) < 0) { free(buf); return (-1); } } cnt = nbytes / sizeof(*ipfw); ipfw = (struct ip_fw *)buf; ret = 0; for (i = 0; i < cnt; i++) { ipfw_to_fr(&ipfw[i], &fr); if ((ret = callback(&fr, arg)) != 0) break; } free(buf); return (ret); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/src/fw-none.c0000644000076500007650000000112407422632520016532 0ustar dugsongdugsong00000000000000/* * fw-none.c * * Copyright (c) 2000 Dug Song * * $Id: fw-none.c 208 2002-01-20 21:23:28Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" fw_t * fw_open(void) { errno = ENOSYS; return (NULL); } int fw_add(fw_t *f, const struct fw_rule *rule) { errno = ENOSYS; return (-1); } int fw_delete(fw_t *f, const struct fw_rule *rule) { errno = ENOSYS; return (-1); } int fw_loop(fw_t *f, fw_handler callback, void *arg) { errno = ENOSYS; return (-1); } fw_t * fw_close(fw_t *f) { return (NULL); } libdnet-1.12/src/fw-pf.c0000644000076500007650000001657710215466441016223 0ustar dugsongdugsong00000000000000/* * fw-pf.c * * Copyright (c) 2001 Dug Song * * $Id: fw-pf.c 608 2005-03-15 05:05:37Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" /* * XXX - cope with moving pf API */ #if defined(DIOCRCLRTABLES) /* XXX - can't isolate the following change: * $OpenBSD: pfvar.h,v 1.112 2002/12/17 12:30:13 mcbride Exp $ * so i'll take 1.119's DIOCRCLRTABLES - 12 days of pf unsupported. */ # define HAVE_PF_CHANGE_GET_TICKET 1 /* OpenBSD 3.3+ - 3.6 */ /* $OpenBSD: pfvar.h,v 1.197 2004/06/14 20:53:27 cedric Exp $ */ /* $OpenBSD: pfvar.h,v 1.130 2003/01/09 10:40:45 cedric Exp $ */ /* $OpenBSD: pfvar.h,v 1.127 2003/01/05 22:14:23 dhartmei Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.v.a.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->addr.v.a.mask.v4.s_addr # define pfioc_changerule pfioc_rule # define oldrule rule # define newrule rule #elif defined(DIOCBEGINADDRS) /* $OpenBSD: pfvar.h,v 1.102 2002/11/23 05:16:58 mcbride Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->addr.mask.v4.s_addr #elif defined(PFRULE_FRAGMENT) /* OpenBSD 3.2 */ /* $OpenBSD: pfvar.h,v 1.68 2002/04/24 18:10:25 dhartmei Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->mask.v4.s_addr #elif defined (PF_AEQ) /* OpenBSD 3.1 */ /* $OpenBSD: pfvar.h,v 1.51 2001/09/15 03:54:40 frantzen Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.v4.s_addr # define PFRA_MASK(ra) (ra)->mask.v4.s_addr #else /* OpenBSD 3.0 */ # define PFRA_ADDR(ra) (ra)->addr # define PFRA_ADDR(ra) (ra)->mask #endif struct fw_handle { int fd; }; static void fr_to_pr(const struct fw_rule *fr, struct pf_rule *pr) { memset(pr, 0, sizeof(*pr)); strlcpy(pr->ifname, fr->fw_device, sizeof(pr->ifname)); pr->action = (fr->fw_op == FW_OP_ALLOW) ? PF_PASS : PF_DROP; pr->direction = (fr->fw_dir == FW_DIR_IN) ? PF_IN : PF_OUT; pr->proto = fr->fw_proto; pr->af = AF_INET; PFRA_ADDR(&pr->src) = fr->fw_src.addr_ip; addr_btom(fr->fw_src.addr_bits, &(PFRA_MASK(&pr->src)), IP_ADDR_LEN); PFRA_ADDR(&pr->dst) = fr->fw_dst.addr_ip; addr_btom(fr->fw_dst.addr_bits, &(PFRA_MASK(&pr->dst)), IP_ADDR_LEN); switch (fr->fw_proto) { case IP_PROTO_ICMP: if (fr->fw_sport[1]) pr->type = (u_char)(fr->fw_sport[0] & fr->fw_sport[1]) + 1; if (fr->fw_dport[1]) pr->code = (u_char)(fr->fw_dport[0] & fr->fw_dport[1]) + 1; break; case IP_PROTO_TCP: case IP_PROTO_UDP: pr->src.port[0] = htons(fr->fw_sport[0]); pr->src.port[1] = htons(fr->fw_sport[1]); if (pr->src.port[0] == pr->src.port[1]) { pr->src.port_op = PF_OP_EQ; } else pr->src.port_op = PF_OP_IRG; pr->dst.port[0] = htons(fr->fw_dport[0]); pr->dst.port[1] = htons(fr->fw_dport[1]); if (pr->dst.port[0] == pr->dst.port[1]) { pr->dst.port_op = PF_OP_EQ; } else pr->dst.port_op = PF_OP_IRG; break; } } static int pr_to_fr(const struct pf_rule *pr, struct fw_rule *fr) { memset(fr, 0, sizeof(*fr)); strlcpy(fr->fw_device, pr->ifname, sizeof(fr->fw_device)); if (pr->action == PF_DROP) fr->fw_op = FW_OP_BLOCK; else if (pr->action == PF_PASS) fr->fw_op = FW_OP_ALLOW; else return (-1); fr->fw_dir = pr->direction == PF_IN ? FW_DIR_IN : FW_DIR_OUT; fr->fw_proto = pr->proto; if (pr->af != AF_INET) return (-1); fr->fw_src.addr_type = ADDR_TYPE_IP; addr_mtob(&(PFRA_MASK(&pr->src)), IP_ADDR_LEN, &fr->fw_src.addr_bits); fr->fw_src.addr_ip = PFRA_ADDR(&pr->src); fr->fw_dst.addr_type = ADDR_TYPE_IP; addr_mtob(&(PFRA_MASK(&pr->dst)), IP_ADDR_LEN, &fr->fw_dst.addr_bits); fr->fw_dst.addr_ip = PFRA_ADDR(&pr->dst); switch (fr->fw_proto) { case IP_PROTO_ICMP: if (pr->type) { fr->fw_sport[0] = pr->type - 1; fr->fw_sport[1] = 0xff; } if (pr->code) { fr->fw_dport[0] = pr->code - 1; fr->fw_dport[1] = 0xff; } break; case IP_PROTO_TCP: case IP_PROTO_UDP: fr->fw_sport[0] = ntohs(pr->src.port[0]); fr->fw_sport[1] = ntohs(pr->src.port[1]); if (pr->src.port_op == PF_OP_EQ) fr->fw_sport[1] = fr->fw_sport[0]; fr->fw_dport[0] = ntohs(pr->dst.port[0]); fr->fw_dport[1] = ntohs(pr->dst.port[1]); if (pr->dst.port_op == PF_OP_EQ) fr->fw_dport[1] = fr->fw_dport[0]; } return (0); } #ifdef HAVE_PF_CHANGE_GET_TICKET static int _fw_cmp(const struct fw_rule *a, const struct fw_rule *b) { if (strcmp(a->fw_device, b->fw_device) != 0 || a->fw_op != b->fw_op || a->fw_dir != b->fw_dir || a->fw_proto != b->fw_proto || addr_cmp(&a->fw_src, &b->fw_src) != 0 || addr_cmp(&a->fw_dst, &b->fw_dst) != 0 || memcmp(a->fw_sport, b->fw_sport, sizeof(a->fw_sport)) != 0 || memcmp(a->fw_dport, b->fw_dport, sizeof(a->fw_dport)) != 0) return (-1); return (0); } #endif fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = open("/dev/pf", O_RDWR)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct pfioc_changerule pcr; assert(fw != NULL && rule != NULL); memset(&pcr, 0, sizeof(pcr)); #ifdef HAVE_PF_CHANGE_GET_TICKET { struct fw_rule fr; if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) return (-1); while ((int)--pcr.nr >= 0) { if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && pr_to_fr(&pcr.rule, &fr) == 0) { if (_fw_cmp(rule, &fr) == 0) { errno = EEXIST; return (-1); } } } } #endif #ifdef DIOCBEGINADDRS { struct pfioc_pooladdr ppa; if (ioctl(fw->fd, DIOCBEGINADDRS, &ppa) < 0) return (-1); pcr.pool_ticket = ppa.ticket; } #endif pcr.action = PF_CHANGE_ADD_TAIL; fr_to_pr(rule, &pcr.newrule); return (ioctl(fw->fd, DIOCCHANGERULE, &pcr)); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct pfioc_changerule pcr; assert(fw != NULL && rule != NULL); memset(&pcr, 0, sizeof(pcr)); #ifdef HAVE_PF_CHANGE_GET_TICKET { struct fw_rule fr; int found = 0; if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) return (-1); while ((int)--pcr.nr >= 0) { if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && pr_to_fr(&pcr.rule, &fr) == 0) { if (_fw_cmp(rule, &fr) == 0) { found = 1; break; } } } if (!found) { errno = ENOENT; return (-1); } } #endif #ifdef DIOCBEGINADDRS { struct pfioc_pooladdr ppa; if (ioctl(fw->fd, DIOCBEGINADDRS, &ppa) < 0) return (-1); pcr.pool_ticket = ppa.ticket; } #endif pcr.action = PF_CHANGE_REMOVE; fr_to_pr(rule, &pcr.oldrule); return (ioctl(fw->fd, DIOCCHANGERULE, &pcr)); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct pfioc_rule pr; struct fw_rule fr; uint32_t n, max; int ret = 0; memset(&pr, 0, sizeof(pr)); if (ioctl(fw->fd, DIOCGETRULES, &pr) < 0) return (-1); for (n = 0, max = pr.nr; n < max; n++) { pr.nr = n; if ((ret = ioctl(fw->fd, DIOCGETRULE, &pr)) < 0) break; #ifdef PF_TABLE_NAME_SIZE /* XXX - actually in r1.125, not 1.126 */ if (pr.rule.src.addr.type == PF_ADDR_TABLE || pr.rule.dst.addr.type == PF_ADDR_TABLE) continue; #endif if (pr_to_fr(&pr.rule, &fr) < 0) continue; if ((ret = callback(&fr, arg)) != 0) break; } return (ret); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/src/fw-pktfilter.c0000644000076500007650000002456010204314223017575 0ustar dugsongdugsong00000000000000/* * fw-pktfilter.c * * Copyright (c) 2002 Dug Song * Copyright (c) 2001 Jean-Baptiste Marchand, Hervé Schauer Consultants. * * $Id: fw-pktfilter.c 587 2005-02-15 06:37:07Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #define PKTFILTER_PIPE "\\\\.\\pipe\\PktFltPipe" #define MAX_RULE_LENGTH 256 #define FILTER_FAILURE 0 /* filter had a syntax error */ #define FILTER_SUCCESS 1 /* filter was correctly added */ #define FILTER_MESSAGE 2 /* informative message returned to the client */ char *icmp_types[] = { "echorep", /* 0: echo reply */ "", /* 1: unused */ "", /* 2: unused */ "unreach", /* 3: destination unreachable */ "squench", /* 4: source quench */ "redir", /* 5: redirect */ "", /* 6: unused */ "", /* 7: unused */ "echo", /* 8: echo request */ "router_adv", /* 9: router advertisement */ "router_sol", /* 10: router solicitation */ "timex", /* 11: time exceeded */ "paramprob", /* 12: parameter problem */ "timest", /* 13: timestamp request */ "timestrep", /* 14: timestamp reply */ "inforeq", /* 15: information request */ "inforep", /* 16: information reply */ "maskreq", /* 17: address mask request */ "maskrep", /* 18: address mask reply */ NULL }; struct fw_handle { IP_ADAPTER_INFO *ifinfo; /* XXX - rules cache for delete lookup? */ }; static int parse_addr(char *p, struct addr *a) { if (strcmp(p, "any") == 0) return (addr_aton("0.0.0.0/0", a)); return (addr_aton(p, a)); } static int parse_portspec(char *str, uint16_t *ports) { char *p = strsep(&str, " "); if (p[0] == '=') { ports[0] = ports[1] = atoi(strsep(&str, " ")); } else if (p[0] == '<') { ports[1] = atoi(strsep(&str, " ")); if (p[1] != '=') ports[1]--; } else if (p[0] == '>') { ports[1] = TCP_PORT_MAX; ports[0] = atoi(strsep(&str, " ")); if (p[1] != '=') ports[0]++; } else if (p[0] != '\0') { if (strcmp(strsep(&str, " "), "><") != 0) return (-1); ports[0] = atoi(p) + 1; ports[1] = atoi(strsep(&str, " ")) - 1; } return (0); } static int parse_icmpspec(char *str, uint16_t *type, uint16_t *code) { char *p, *e; int i; p = strsep(&str, " "); for (i = 0; icmp_types[i] && strcmp(p, icmp_types[i]); i++) ; if (icmp_types[i] == NULL) { i = strtol(p, &e, 10); if (*e != '\0') return (-1); } type[0] = i; type[1] = 0xff; p = strsep(&str, " "); if (p != NULL && strcmp(p, "code")) { p = strsep(&str, " "); i = strtol(p, &e, 10); if (*e != '\0') return (-1); code[0] = i; code[1] = 0xff; } return (0); } /* on all on proto all on proto from [ports] to [ports] on proto icmp all [icmp-type [code ]] on proto icmp from to [icmp-type [code ]] */ static int parse_rule(char *str, struct fw_rule *rule) { char *p, *q; memset(rule, 0, sizeof(*rule)); /* action */ p = strsep(&str, " "); if (strcmp(p, "block") == 0) rule->fw_op = FW_OP_BLOCK; else if (strcmp(p, "pass") == 0) rule->fw_op = FW_OP_ALLOW; else return (-1); /* direction */ p = strsep(&str, " "); if (strcmp(p, "in") == 0) rule->fw_dir = FW_DIR_IN; else if (strcmp(p, "out") == 0) rule->fw_dir = FW_DIR_OUT; else return (-1); /* device */ if (strcmp(strsep(&str, " "), "on") != 0) return (-1); p = strsep(&str, " "); /* XXX - handle bug in pktfltsrv.c */ if ((q = strstr(p, "proto")) != NULL) *q = '\0'; if (strcmp(p, "all") != 0) strlcpy(rule->fw_device, p, sizeof(rule->fw_device)); /* proto */ p = strsep(&str, " "); /* XXX - handle bug in pktfltsrv.c */ if (strcmp(p, "proto") == 0) p = strsep(&str, " "); /* XXX - handle default rules */ if (strcmp(p, "all") == 0) return (0); if (strcmp(p, "icmp") == 0) rule->fw_proto = IP_PROTO_ICMP; else if (strcmp(p, "tcp") == 0) rule->fw_proto = IP_PROTO_TCP; else if (strcmp(p, "udp") == 0) rule->fw_proto = IP_PROTO_UDP; else rule->fw_proto = atoi(p); /* source */ p = strsep(&str, " "); if (strcmp(p, "all") == 0) return (0); if (strcmp(p, "from") != 0) goto icmp_type_code; p = strsep(&str, " "); if (parse_addr(p, &rule->fw_src) < 0) return (-1); /* source port */ p = strsep(&str, " "); if (strcmp(p, "port") == 0) { if ((p = strstr(str, " to ")) == NULL) return (-1); *p++ = '\0'; if (parse_portspec(str, rule->fw_sport) < 0) return (-1); str = p + 3; } else if (strcmp(p, "to") != 0) return (-1); /* destination */ p = strsep(&str, " "); if (parse_addr(p, &rule->fw_dst) < 0) return (-1); /* destination port */ p = strsep(&str, " "); if (strcmp(p, "port") == 0) return (parse_portspec(str, rule->fw_dport)); icmp_type_code: /* icmp-type, code */ if (strcmp(p, "icmp-type") == 0) { if (parse_icmpspec(str, rule->fw_sport, rule->fw_dport) < 0) return (-1); } return (0); } static int format_rule(const struct fw_rule *rule, char *buf, int len) { char tmp[128]; strlcpy(buf, (rule->fw_op == FW_OP_ALLOW) ? "pass " : "block ", len); strlcat(buf, (rule->fw_dir == FW_DIR_IN) ? "in " : "out ", len); snprintf(tmp, sizeof(tmp), "on %s ", rule->fw_device); strlcat(buf, tmp, len); if (rule->fw_proto != 0) { snprintf(tmp, sizeof(tmp), "proto %d ", rule->fw_proto); strlcat(buf, tmp, len); } /* source */ if (rule->fw_src.addr_type != ADDR_TYPE_NONE) { snprintf(tmp, sizeof(tmp), "from %s ", addr_ntoa(&rule->fw_src)); strlcat(buf, tmp, len); } else strlcat(buf, "from any ", len); /* sport */ if (rule->fw_proto == IP_PROTO_TCP || rule->fw_proto == IP_PROTO_UDP) { if (rule->fw_sport[0] == rule->fw_sport[1]) snprintf(tmp, sizeof(tmp), "port = %d ", rule->fw_sport[0]); else snprintf(tmp, sizeof(tmp), "port %d >< %d ", rule->fw_sport[0] - 1, rule->fw_sport[1] + 1); strlcat(buf, tmp, len); } /* destination */ if (rule->fw_dst.addr_type != ADDR_TYPE_NONE) { snprintf(tmp, sizeof(tmp), "to %s ", addr_ntoa(&rule->fw_dst)); strlcat(buf, tmp, len); } else strlcat(buf, "to any ", len); /* dport */ if (rule->fw_proto == IP_PROTO_TCP || rule->fw_proto == IP_PROTO_UDP) { if (rule->fw_dport[0] == rule->fw_dport[1]) snprintf(tmp, sizeof(tmp), "port = %d", rule->fw_dport[0]); else snprintf(tmp, sizeof(tmp), "port %d >< %d", rule->fw_dport[0] - 1, rule->fw_dport[1] + 1); strlcat(buf, tmp, len); } else if (rule->fw_proto == IP_PROTO_ICMP) { if (rule->fw_sport[1]) { snprintf(tmp, sizeof(tmp), "icmp-type %d", rule->fw_sport[0]); strlcat(buf, tmp, len); if (rule->fw_dport[1]) { snprintf(tmp, sizeof(tmp), " code %d", rule->fw_dport[0]); strlcat(buf, tmp, len); } } } return (strlen(buf)); } static char * call_pipe(const char *msg, int len) { HANDLE *pipe; DWORD i; char *p, *reply, status; if (!WaitNamedPipe(PKTFILTER_PIPE, NMPWAIT_USE_DEFAULT_WAIT) || (pipe = CreateFile(PKTFILTER_PIPE, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) { return (NULL); } reply = NULL; if (WriteFile(pipe, msg, len, &i, NULL)) { if (ReadFile(pipe, &status, sizeof(status), &i, NULL)) { if (status == FILTER_FAILURE) { ReadFile(pipe, &status, sizeof(status), &i, NULL); } else if (status == FILTER_MESSAGE) { /* get msg length */ if (ReadFile(pipe, &len, 4, &i, NULL)) { /* get msg */ p = reply = calloc(1, len + 1); if (!ReadFile(pipe, reply, len, &i, NULL)) { free(reply); reply = NULL; } } } else if (status == FILTER_SUCCESS) reply = strdup(""); /* XXX */ } } CloseHandle(pipe); return (reply); } fw_t * fw_open(void) { fw_t *f; IP_ADAPTER_INFO *ifinfo; ULONG size; if ((f = calloc(1, sizeof(*f))) == NULL) return (NULL); size = sizeof(*f->ifinfo); f->ifinfo = malloc(size); if (GetAdaptersInfo(f->ifinfo, &size) != ERROR_SUCCESS) { free(f->ifinfo); f->ifinfo = malloc(size); GetAdaptersInfo(f->ifinfo, &size); } /* XXX - normalize interface names. */ for (ifinfo = f->ifinfo; ifinfo != NULL; ifinfo = ifinfo->Next) { char *fmt; if (ifinfo->Type == MIB_IF_TYPE_ETHERNET) fmt = "eth"; else if (ifinfo->Type == MIB_IF_TYPE_PPP) fmt = "ppp"; else if (ifinfo->Type == MIB_IF_TYPE_SLIP) fmt = "sl"; else if (ifinfo->Type == MIB_IF_TYPE_LOOPBACK) fmt = "lo"; else if (ifinfo->Type == MIB_IF_TYPE_TOKENRING) fmt = "tr"; else if (ifinfo->Type == MIB_IF_TYPE_FDDI) fmt = "fd"; else fmt = "if"; sprintf(ifinfo->AdapterName, "%s%lu", fmt, ifinfo->ComboIndex); } return (f); } int fw_add(fw_t *f, const struct fw_rule *rule) { char *p, buf[MAX_RULE_LENGTH]; int len; len = format_rule(rule, buf, sizeof(buf)); if ((p = call_pipe(buf, len)) == NULL) return (-1); free(p); return (0); } int fw_delete(fw_t *f, const struct fw_rule *rule) { struct fw_rule tmp; char *p, *line, *msg, cmd[128], buf[MAX_RULE_LENGTH]; int n, ruleno, len; format_rule(rule, buf, sizeof(buf)); len = snprintf(cmd, sizeof(cmd), "List on %s", rule->fw_device); if ((msg = call_pipe(cmd, len)) == NULL) return (-1); for (ruleno = 0, p = msg; (line = strsep(&p, "\r\n")) != NULL; ) { if (strncmp(line, "rule ", 5) == 0) { line += 5; n = atoi(strsep(&line, ":")); if (parse_rule(line + 1, &tmp) == 0 && memcmp(&tmp, rule, sizeof(tmp)) == 0) { ruleno = n; break; } } } free(msg); if (ruleno == 0) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } len = snprintf(cmd, sizeof(cmd), "delete %d on %s", ruleno, rule->fw_device); if ((p = call_pipe(cmd, len)) == NULL) return (-1); free(p); return (0); } int fw_loop(fw_t *f, fw_handler callback, void *arg) { struct fw_rule rule; IP_ADAPTER_INFO *ifinfo; char *p, *line, *msg, buf[MAX_RULE_LENGTH]; int len, ret; for (ret = 0, ifinfo = f->ifinfo; ret == 0 && ifinfo != NULL; ifinfo = ifinfo->Next) { len = snprintf(buf, sizeof(buf), "list on %s", ifinfo->AdapterName); if ((msg = call_pipe(buf, len)) == NULL) return (-1); /* parse msg */ for (p = msg; (line = strsep(&p, "\r\n")) != NULL; ) { if (*line == '\0' || *line == '#' || isspace(*line)) continue; if (parse_rule(line, &rule) == 0) { if ((ret = callback(&rule, arg)) != 0) break; } } free(msg); } return (ret); } fw_t * fw_close(fw_t *f) { if (f != NULL) { free(f->ifinfo); free(f); } return (NULL); } libdnet-1.12/src/intf-win32.c0000644000076500007650000001766110466533744017110 0ustar dugsongdugsong00000000000000/* * intf-win32.c * * Copyright (c) 2002 Dug Song * * $Id: intf-win32.c 632 2006-08-10 04:36:52Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" struct ifcombo { DWORD *idx; int cnt; int max; }; /* XXX - ipifcons.h incomplete, use IANA ifTypes MIB */ #define MIB_IF_TYPE_TUNNEL 131 #define MIB_IF_TYPE_MAX 255 struct intf_handle { struct ifcombo ifcombo[MIB_IF_TYPE_MAX]; MIB_IFTABLE *iftable; MIB_IPADDRTABLE *iptable; }; static char * _ifcombo_name(int type) { char *name = "eth"; /* XXX */ if (type == MIB_IF_TYPE_TOKENRING) { name = "tr"; } else if (type == MIB_IF_TYPE_FDDI) { name = "fddi"; } else if (type == MIB_IF_TYPE_PPP) { name = "ppp"; } else if (type == MIB_IF_TYPE_LOOPBACK) { name = "lo"; } else if (type == MIB_IF_TYPE_SLIP) { name = "sl"; } else if (type == MIB_IF_TYPE_TUNNEL) { name = "tun"; } return (name); } static int _ifcombo_type(const char *device) { int type = INTF_TYPE_OTHER; if (strncmp(device, "eth", 3) == 0) { type = INTF_TYPE_ETH; } else if (strncmp(device, "tr", 2) == 0) { type = INTF_TYPE_TOKENRING; } else if (strncmp(device, "fd", 2) == 0) { type = INTF_TYPE_FDDI; } else if (strncmp(device, "ppp", 3) == 0) { type = INTF_TYPE_PPP; } else if (strncmp(device, "lo", 2) == 0) { type = INTF_TYPE_LOOPBACK; } else if (strncmp(device, "sl", 2) == 0) { type = INTF_TYPE_SLIP; } else if (strncmp(device, "tun", 3) == 0) { type = INTF_TYPE_TUN; } return (type); } static void _ifcombo_add(struct ifcombo *ifc, DWORD idx) { if (ifc->cnt == ifc->max) { if (ifc->idx) { ifc->max *= 2; ifc->idx = realloc(ifc->idx, sizeof(ifc->idx[0]) * ifc->max); } else { ifc->max = 8; ifc->idx = malloc(sizeof(ifc->idx[0]) * ifc->max); } } ifc->idx[ifc->cnt++] = idx; } static void _ifrow_to_entry(intf_t *intf, MIB_IFROW *ifrow, struct intf_entry *entry) { struct addr *ap, *lap; int i; memset(entry, 0, sizeof(*entry)); for (i = 0; i < intf->ifcombo[ifrow->dwType].cnt; i++) { if (intf->ifcombo[ifrow->dwType].idx[i] == ifrow->dwIndex) break; } /* XXX - dwType matches MIB-II ifType. */ snprintf(entry->intf_name, sizeof(entry->intf_name), "%s%lu", _ifcombo_name(ifrow->dwType), i); entry->intf_type = (uint16_t)ifrow->dwType; /* Get interface flags. */ entry->intf_flags = 0; if (ifrow->dwAdminStatus == MIB_IF_ADMIN_STATUS_UP && (ifrow->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL || ifrow->dwOperStatus == MIB_IF_OPER_STATUS_CONNECTED)) entry->intf_flags |= INTF_FLAG_UP; if (ifrow->dwType == MIB_IF_TYPE_LOOPBACK) entry->intf_flags |= INTF_FLAG_LOOPBACK; else entry->intf_flags |= INTF_FLAG_MULTICAST; /* Get interface MTU. */ entry->intf_mtu = ifrow->dwMtu; /* Get hardware address. */ if (ifrow->dwPhysAddrLen == ETH_ADDR_LEN) { entry->intf_link_addr.addr_type = ADDR_TYPE_ETH; entry->intf_link_addr.addr_bits = ETH_ADDR_BITS; memcpy(&entry->intf_link_addr.addr_eth, ifrow->bPhysAddr, ETH_ADDR_LEN); } /* Get addresses. */ ap = entry->intf_alias_addrs; lap = ap + ((entry->intf_len - sizeof(*entry)) / sizeof(entry->intf_alias_addrs[0])); for (i = 0; i < (int)intf->iptable->dwNumEntries; i++) { if (intf->iptable->table[i].dwIndex == ifrow->dwIndex && intf->iptable->table[i].dwAddr != 0) { if (entry->intf_addr.addr_type == ADDR_TYPE_NONE) { /* Set primary address if unset. */ entry->intf_addr.addr_type = ADDR_TYPE_IP; entry->intf_addr.addr_ip = intf->iptable->table[i].dwAddr; addr_mtob(&intf->iptable->table[i].dwMask, IP_ADDR_LEN, &entry->intf_addr.addr_bits); } else if (ap < lap) { /* Set aliases. */ ap->addr_type = ADDR_TYPE_IP; ap->addr_ip = intf->iptable->table[i].dwAddr; addr_mtob(&intf->iptable->table[i].dwMask, IP_ADDR_LEN, &ap->addr_bits); ap++, entry->intf_alias_num++; } } } entry->intf_len = (u_char *)ap - (u_char *)entry; } static int _refresh_tables(intf_t *intf) { MIB_IFROW *ifrow; ULONG len; u_int i, ret; /* Get interface table. */ for (len = sizeof(intf->iftable[0]); ; ) { if (intf->iftable) free(intf->iftable); intf->iftable = malloc(len); ret = GetIfTable(intf->iftable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } /* Get IP address table. */ for (len = sizeof(intf->iptable[0]); ; ) { if (intf->iptable) free(intf->iptable); intf->iptable = malloc(len); ret = GetIpAddrTable(intf->iptable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } /* * Map "unfriendly" win32 interface indices to ours. * XXX - like IP_ADAPTER_INFO ComboIndex */ for (i = 0; i < intf->iftable->dwNumEntries; i++) { ifrow = &intf->iftable->table[i]; if (ifrow->dwType < MIB_IF_TYPE_MAX) { _ifcombo_add(&intf->ifcombo[ifrow->dwType], ifrow->dwIndex); } else return (-1); } return (0); } static int _find_ifindex(intf_t *intf, const char *device) { char *p = (char *)device; int n, type = _ifcombo_type(device); while (isalpha(*p)) p++; n = atoi(p); return (intf->ifcombo[type].idx[n]); } intf_t * intf_open(void) { return (calloc(1, sizeof(intf_t))); } int intf_get(intf_t *intf, struct intf_entry *entry) { MIB_IFROW ifrow; if (_refresh_tables(intf) < 0) return (-1); ifrow.dwIndex = _find_ifindex(intf, entry->intf_name); if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } int intf_get_src(intf_t *intf, struct intf_entry *entry, struct addr *src) { MIB_IFROW ifrow; MIB_IPADDRROW *iprow; int i; if (src->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } if (_refresh_tables(intf) < 0) return (-1); for (i = 0; i < (int)intf->iptable->dwNumEntries; i++) { iprow = &intf->iptable->table[i]; if (iprow->dwAddr == src->addr_ip) { ifrow.dwIndex = iprow->dwIndex; if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } } errno = ENXIO; return (-1); } int intf_get_dst(intf_t *intf, struct intf_entry *entry, struct addr *dst) { MIB_IFROW ifrow; if (dst->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } if (GetBestInterface(dst->addr_ip, &ifrow.dwIndex) != NO_ERROR) return (-1); if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); if (_refresh_tables(intf) < 0) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } int intf_set(intf_t *intf, const struct intf_entry *entry) { /* * XXX - could set interface up/down via SetIfEntry(), * but what about the rest of the configuration? :-( * {Add,Delete}IPAddress for 2000/XP only */ #if 0 /* Set interface address. XXX - 2000/XP only? */ if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { ULONG ctx = 0, inst = 0; UINT ip, mask; memcpy(&ip, &entry->intf_addr.addr_ip, IP_ADDR_LEN); addr_btom(entry->intf_addr.addr_bits, &mask, IP_ADDR_LEN); if (AddIPAddress(ip, mask, _find_ifindex(intf, entry->intf_name), &ctx, &inst) != NO_ERROR) { return (-1); } return (0); } #endif errno = ENOSYS; SetLastError(ERROR_NOT_SUPPORTED); return (-1); } int intf_loop(intf_t *intf, intf_handler callback, void *arg) { struct intf_entry *entry; u_char ebuf[1024]; int i, ret = 0; if (_refresh_tables(intf) < 0) return (-1); entry = (struct intf_entry *)ebuf; for (i = 0; i < (int)intf->iftable->dwNumEntries; i++) { entry->intf_len = sizeof(ebuf); _ifrow_to_entry(intf, &intf->iftable->table[i], entry); if ((ret = (*callback)(entry, arg)) != 0) break; } return (ret); } intf_t * intf_close(intf_t *intf) { int i; if (intf != NULL) { for (i = 0; i < MIB_IF_TYPE_MAX; i++) { if (intf->ifcombo[i].idx) free(intf->ifcombo[i].idx); } if (intf->iftable) free(intf->iftable); if (intf->iptable) free(intf->iptable); free(intf); } return (NULL); } libdnet-1.12/src/intf.c0000644000076500007650000004270210360406075016127 0ustar dugsongdugsong00000000000000/* * intf.c * * Copyright (c) 2001 Dug Song * * $Id: intf.c 616 2006-01-09 07:09:49Z dugsong $ */ #include "config.h" #include #include #include #include #ifdef HAVE_SYS_SOCKIO_H # include #endif /* XXX - AIX */ #ifndef IP_MULTICAST # define IP_MULTICAST #endif #include #ifdef HAVE_NET_IF_VAR_H # include #endif #undef IP_MULTICAST /* XXX - IPv6 ioctls */ #ifdef HAVE_NETINET_IN_VAR_H # include # include #endif #include #include #include #include #include #include "dnet.h" /* XXX - Tru64 */ #if defined(SIOCRIPMTU) && defined(SIOCSIPMTU) # define SIOCGIFMTU SIOCRIPMTU # define SIOCSIFMTU SIOCSIPMTU #endif /* XXX - HP-UX */ #if defined(SIOCADDIFADDR) && defined(SIOCDELIFADDR) # define SIOCAIFADDR SIOCADDIFADDR # define SIOCDIFADDR SIOCDELIFADDR #endif /* XXX - HP-UX, Solaris */ #if !defined(ifr_mtu) && defined(ifr_metric) # define ifr_mtu ifr_metric #endif #ifdef HAVE_SOCKADDR_SA_LEN # define NEXTIFR(i) ((struct ifreq *)((u_char *)&i->ifr_addr + \ (i->ifr_addr.sa_len ? i->ifr_addr.sa_len : \ sizeof(i->ifr_addr)))) #else # define NEXTIFR(i) (i + 1) #endif /* XXX - superset of ifreq, for portable SIOC{A,D}IFADDR */ struct dnet_ifaliasreq { char ifra_name[IFNAMSIZ]; struct sockaddr ifra_addr; struct sockaddr ifra_brdaddr; struct sockaddr ifra_mask; int ifra_cookie; /* XXX - IRIX!@#$ */ }; struct intf_handle { int fd; int fd6; struct ifconf ifc; u_char ifcbuf[4192]; }; static int intf_flags_to_iff(u_short flags, int iff) { if (flags & INTF_FLAG_UP) iff |= IFF_UP; else iff &= ~IFF_UP; if (flags & INTF_FLAG_NOARP) iff |= IFF_NOARP; else iff &= ~IFF_NOARP; return (iff); } static u_int intf_iff_to_flags(int iff) { u_int n = 0; if (iff & IFF_UP) n |= INTF_FLAG_UP; if (iff & IFF_LOOPBACK) n |= INTF_FLAG_LOOPBACK; if (iff & IFF_POINTOPOINT) n |= INTF_FLAG_POINTOPOINT; if (iff & IFF_NOARP) n |= INTF_FLAG_NOARP; if (iff & IFF_BROADCAST) n |= INTF_FLAG_BROADCAST; if (iff & IFF_MULTICAST) n |= INTF_FLAG_MULTICAST; return (n); } intf_t * intf_open(void) { intf_t *intf; if ((intf = calloc(1, sizeof(*intf))) != NULL) { intf->fd = intf->fd6 = -1; if ((intf->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (intf_close(intf)); #ifdef SIOCGIFNETMASK_IN6 if ((intf->fd6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { # ifdef EPROTONOSUPPORT if (errno != EPROTONOSUPPORT) # endif return (intf_close(intf)); } #endif } return (intf); } static int _intf_delete_addrs(intf_t *intf, struct intf_entry *entry) { #if defined(SIOCDIFADDR) struct dnet_ifaliasreq ifra; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { addr_ntos(&entry->intf_addr, &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { addr_ntos(&entry->intf_dst_addr, &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } #elif defined(SIOCLIFREMOVEIF) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* XXX - overloading Solaris lifreq with ifreq */ ioctl(intf->fd, SIOCLIFREMOVEIF, &ifr); #endif return (0); } static int _intf_delete_aliases(intf_t *intf, struct intf_entry *entry) { int i; #if defined(SIOCDIFADDR) && !defined(__linux__) /* XXX - see Linux below */ struct dnet_ifaliasreq ifra; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); for (i = 0; i < (int)entry->intf_alias_num; i++) { addr_ntos(&entry->intf_alias_addrs[i], &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } #else struct ifreq ifr; for (i = 0; i < entry->intf_alias_num; i++) { snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s:%d", entry->intf_name, i + 1); # ifdef SIOCLIFREMOVEIF /* XXX - overloading Solaris lifreq with ifreq */ ioctl(intf->fd, SIOCLIFREMOVEIF, &ifr); # else /* XXX - only need to set interface down on Linux */ ifr.ifr_flags = 0; ioctl(intf->fd, SIOCSIFFLAGS, &ifr); # endif } #endif return (0); } static int _intf_add_aliases(intf_t *intf, const struct intf_entry *entry) { int i; #ifdef SIOCAIFADDR struct dnet_ifaliasreq ifra; struct addr bcast; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); for (i = 0; i < (int)entry->intf_alias_num; i++) { if (entry->intf_alias_addrs[i].addr_type != ADDR_TYPE_IP) continue; if (addr_ntos(&entry->intf_alias_addrs[i], &ifra.ifra_addr) < 0) return (-1); addr_bcast(&entry->intf_alias_addrs[i], &bcast); addr_ntos(&bcast, &ifra.ifra_brdaddr); addr_btos(entry->intf_alias_addrs[i].addr_bits, &ifra.ifra_mask); if (ioctl(intf->fd, SIOCAIFADDR, &ifra) < 0) return (-1); } #else struct ifreq ifr; int n = 1; for (i = 0; i < entry->intf_alias_num; i++) { if (entry->intf_alias_addrs[i].addr_type != ADDR_TYPE_IP) continue; snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s:%d", entry->intf_name, n++); # ifdef SIOCLIFADDIF if (ioctl(intf->fd, SIOCLIFADDIF, &ifr) < 0) return (-1); # endif if (addr_ntos(&entry->intf_alias_addrs[i], &ifr.ifr_addr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFADDR, &ifr) < 0) return (-1); } strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); #endif return (0); } int intf_set(intf_t *intf, const struct intf_entry *entry) { struct ifreq ifr; struct intf_entry *orig; struct addr bcast; u_char buf[BUFSIZ]; orig = (struct intf_entry *)buf; orig->intf_len = sizeof(buf); strcpy(orig->intf_name, entry->intf_name); if (intf_get(intf, orig) < 0) return (-1); /* Delete any existing aliases. */ if (_intf_delete_aliases(intf, orig) < 0) return (-1); /* Delete any existing addrs. */ if (_intf_delete_addrs(intf, orig) < 0) return (-1); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* Set interface MTU. */ if (entry->intf_mtu != 0) { ifr.ifr_mtu = entry->intf_mtu; if (ioctl(intf->fd, SIOCSIFMTU, &ifr) < 0) return (-1); } /* Set interface address. */ if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { #ifdef BSD /* XXX - why must this happen before SIOCSIFADDR? */ if (addr_btos(entry->intf_addr.addr_bits, &ifr.ifr_addr) == 0) { if (ioctl(intf->fd, SIOCSIFNETMASK, &ifr) < 0) return (-1); } #endif if (addr_ntos(&entry->intf_addr, &ifr.ifr_addr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFADDR, &ifr) < 0 && errno != EEXIST) return (-1); if (addr_btos(entry->intf_addr.addr_bits, &ifr.ifr_addr) == 0 #ifdef __linux__ && entry->intf_addr.addr_ip != 0 #endif ) { if (ioctl(intf->fd, SIOCSIFNETMASK, &ifr) < 0) return (-1); } if (addr_bcast(&entry->intf_addr, &bcast) == 0) { if (addr_ntos(&bcast, &ifr.ifr_broadaddr) == 0) { /* XXX - ignore error from non-broadcast ifs */ ioctl(intf->fd, SIOCSIFBRDADDR, &ifr); } } } /* Set link-level address. */ if (entry->intf_link_addr.addr_type == ADDR_TYPE_ETH && addr_cmp(&entry->intf_link_addr, &orig->intf_link_addr) != 0) { #if defined(SIOCSIFHWADDR) if (addr_ntos(&entry->intf_link_addr, &ifr.ifr_hwaddr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFHWADDR, &ifr) < 0) return (-1); #elif defined (SIOCSIFLLADDR) memcpy(ifr.ifr_addr.sa_data, &entry->intf_link_addr.addr_eth, ETH_ADDR_LEN); ifr.ifr_addr.sa_len = ETH_ADDR_LEN; if (ioctl(intf->fd, SIOCSIFLLADDR, &ifr) < 0) return (-1); #else eth_t *eth; if ((eth = eth_open(entry->intf_name)) == NULL) return (-1); if (eth_set(eth, &entry->intf_link_addr.addr_eth) < 0) { eth_close(eth); return (-1); } eth_close(eth); #endif } /* Set point-to-point destination. */ if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { if (addr_ntos(&entry->intf_dst_addr, &ifr.ifr_dstaddr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFDSTADDR, &ifr) < 0 && errno != EEXIST) return (-1); } /* Add aliases. */ if (_intf_add_aliases(intf, entry) < 0) return (-1); /* Set interface flags. */ if (ioctl(intf->fd, SIOCGIFFLAGS, &ifr) < 0) return (-1); ifr.ifr_flags = intf_flags_to_iff(entry->intf_flags, ifr.ifr_flags); if (ioctl(intf->fd, SIOCSIFFLAGS, &ifr) < 0) return (-1); return (0); } /* XXX - this is total crap. how to do this without walking ifnet? */ static void _intf_set_type(struct intf_entry *entry) { if ((entry->intf_flags & INTF_FLAG_BROADCAST) != 0) entry->intf_type = INTF_TYPE_ETH; else if ((entry->intf_flags & INTF_FLAG_POINTOPOINT) != 0) entry->intf_type = INTF_TYPE_TUN; else if ((entry->intf_flags & INTF_FLAG_LOOPBACK) != 0) entry->intf_type = INTF_TYPE_LOOPBACK; else entry->intf_type = INTF_TYPE_OTHER; } static int _intf_get_noalias(intf_t *intf, struct intf_entry *entry) { struct ifreq ifr; strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* Get interface flags. */ if (ioctl(intf->fd, SIOCGIFFLAGS, &ifr) < 0) return (-1); entry->intf_flags = intf_iff_to_flags(ifr.ifr_flags); _intf_set_type(entry); /* Get interface MTU. */ if (ioctl(intf->fd, SIOCGIFMTU, &ifr) < 0) return (-1); entry->intf_mtu = ifr.ifr_mtu; entry->intf_addr.addr_type = entry->intf_dst_addr.addr_type = entry->intf_link_addr.addr_type = ADDR_TYPE_NONE; /* Get primary interface address. */ if (ioctl(intf->fd, SIOCGIFADDR, &ifr) == 0) { addr_ston(&ifr.ifr_addr, &entry->intf_addr); if (ioctl(intf->fd, SIOCGIFNETMASK, &ifr) < 0) return (-1); addr_stob(&ifr.ifr_addr, &entry->intf_addr.addr_bits); } /* Get other addresses. */ if (entry->intf_type == INTF_TYPE_TUN) { if (ioctl(intf->fd, SIOCGIFDSTADDR, &ifr) == 0) { if (addr_ston(&ifr.ifr_addr, &entry->intf_dst_addr) < 0) return (-1); } } else if (entry->intf_type == INTF_TYPE_ETH) { #if defined(SIOCGIFHWADDR) if (ioctl(intf->fd, SIOCGIFHWADDR, &ifr) < 0) return (-1); if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0) return (-1); #elif defined(SIOCRPHYSADDR) /* Tru64 */ struct ifdevea *ifd = (struct ifdevea *)𝔦 /* XXX */ if (ioctl(intf->fd, SIOCRPHYSADDR, ifd) < 0) return (-1); addr_pack(&entry->intf_link_addr, ADDR_TYPE_ETH, ETH_ADDR_BITS, ifd->current_pa, ETH_ADDR_LEN); #else eth_t *eth; if ((eth = eth_open(entry->intf_name)) != NULL) { if (!eth_get(eth, &entry->intf_link_addr.addr_eth)) { entry->intf_link_addr.addr_type = ADDR_TYPE_ETH; entry->intf_link_addr.addr_bits = ETH_ADDR_BITS; } eth_close(eth); } #endif } return (0); } #ifdef SIOCLIFADDR /* XXX - aliases on IRIX don't show up in SIOCGIFCONF */ static int _intf_get_aliases(intf_t *intf, struct intf_entry *entry) { struct dnet_ifaliasreq ifra; struct addr *ap, *lap; strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); addr_ntos(&entry->intf_addr, &ifra.ifra_addr); addr_btos(entry->intf_addr.addr_bits, &ifra.ifra_mask); memset(&ifra.ifra_brdaddr, 0, sizeof(ifra.ifra_brdaddr)); ifra.ifra_cookie = 1; ap = entry->intf_alias_addrs; lap = (struct addr *)((u_char *)entry + entry->intf_len); while (ioctl(intf->fd, SIOCLIFADDR, &ifra) == 0 && ifra.ifra_cookie > 0 && (ap + 1) < lap) { if (addr_ston(&ifra.ifra_addr, ap) < 0) break; ap++, entry->intf_alias_num++; } entry->intf_len = (u_char *)ap - (u_char *)entry; return (0); } #else static int _intf_get_aliases(intf_t *intf, struct intf_entry *entry) { struct ifreq *ifr, *lifr; struct addr *ap, *lap; char *p; if (intf->ifc.ifc_len < (int)sizeof(*ifr)) { errno = EINVAL; return (-1); } entry->intf_alias_num = 0; ap = entry->intf_alias_addrs; lifr = (struct ifreq *)intf->ifc.ifc_buf + (intf->ifc.ifc_len / sizeof(*lifr)); lap = (struct addr *)((u_char *)entry + entry->intf_len); /* Get addresses for this interface. */ for (ifr = intf->ifc.ifc_req; ifr < lifr && (ap + 1) < lap; ifr = NEXTIFR(ifr)) { /* XXX - Linux, Solaris ifaliases */ if ((p = strchr(ifr->ifr_name, ':')) != NULL) *p = '\0'; if (strcmp(ifr->ifr_name, entry->intf_name) != 0) continue; if (addr_ston(&ifr->ifr_addr, ap) < 0) continue; /* XXX */ if (ap->addr_type == ADDR_TYPE_ETH) { memcpy(&entry->intf_link_addr, ap, sizeof(*ap)); continue; } else if (ap->addr_type == ADDR_TYPE_IP) { if (ap->addr_ip == entry->intf_addr.addr_ip || ap->addr_ip == entry->intf_dst_addr.addr_ip) continue; } #ifdef SIOCGIFNETMASK_IN6 else if (ap->addr_type == ADDR_TYPE_IP6 && intf->fd6 != -1) { struct in6_ifreq ifr6; /* XXX - sizeof(ifr) < sizeof(ifr6) */ memcpy(&ifr6, ifr, sizeof(ifr6)); if (ioctl(intf->fd6, SIOCGIFNETMASK_IN6, &ifr6) == 0) { addr_stob((struct sockaddr *)&ifr6.ifr_addr, &ap->addr_bits); } else perror("SIOCGIFNETMASK_IN6"); } #endif ap++, entry->intf_alias_num++; } #ifdef HAVE_LINUX_PROCFS #define PROC_INET6_FILE "/proc/net/if_inet6" { FILE *f; char buf[256], s[8][5], name[INTF_NAME_LEN]; u_int idx, bits, scope, flags; if ((f = fopen(PROC_INET6_FILE, "r")) != NULL) { while (ap < lap && fgets(buf, sizeof(buf), f) != NULL) { sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x %02x %02x %02x %32s\n", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], &idx, &bits, &scope, &flags, name); if (strcmp(name, entry->intf_name) == 0) { snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], bits); addr_aton(buf, ap); ap++, entry->intf_alias_num++; } } fclose(f); } } #endif entry->intf_len = (u_char *)ap - (u_char *)entry; return (0); } #endif /* SIOCLIFADDR */ int intf_get(intf_t *intf, struct intf_entry *entry) { if (_intf_get_noalias(intf, entry) < 0) return (-1); #ifndef SIOCLIFADDR intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); #endif return (_intf_get_aliases(intf, entry)); } static int _match_intf_src(const struct intf_entry *entry, void *arg) { struct intf_entry *save = (struct intf_entry *)arg; if (entry->intf_addr.addr_type == ADDR_TYPE_IP && entry->intf_addr.addr_ip == save->intf_addr.addr_ip) { /* XXX - truncated result if entry is too small. */ if (save->intf_len < entry->intf_len) memcpy(save, entry, save->intf_len); else memcpy(save, entry, entry->intf_len); return (1); } return (0); } int intf_get_src(intf_t *intf, struct intf_entry *entry, struct addr *src) { memcpy(&entry->intf_addr, src, sizeof(*src)); if (intf_loop(intf, _match_intf_src, entry) != 1) { errno = ENXIO; return (-1); } return (0); } int intf_get_dst(intf_t *intf, struct intf_entry *entry, struct addr *dst) { struct sockaddr_in sin; int n; if (dst->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } addr_ntos(dst, (struct sockaddr *)&sin); sin.sin_port = htons(666); if (connect(intf->fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) return (-1); n = sizeof(sin); if (getsockname(intf->fd, (struct sockaddr *)&sin, &n) < 0) return (-1); addr_ston((struct sockaddr *)&sin, &entry->intf_addr); if (intf_loop(intf, _match_intf_src, entry) != 1) return (-1); return (0); } #ifdef HAVE_LINUX_PROCFS #define PROC_DEV_FILE "/proc/net/dev" int intf_loop(intf_t *intf, intf_handler callback, void *arg) { FILE *fp; struct intf_entry *entry; char *p, buf[BUFSIZ], ebuf[BUFSIZ]; int ret; entry = (struct intf_entry *)ebuf; if ((fp = fopen(PROC_DEV_FILE, "r")) == NULL) return (-1); intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); ret = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { if ((p = strchr(buf, ':')) == NULL) continue; *p = '\0'; for (p = buf; *p == ' '; p++) ; memset(ebuf, 0, sizeof(ebuf)); strlcpy(entry->intf_name, p, sizeof(entry->intf_name)); entry->intf_len = sizeof(ebuf); if (_intf_get_noalias(intf, entry) < 0) { ret = -1; break; } if (_intf_get_aliases(intf, entry) < 0) { ret = -1; break; } if ((ret = (*callback)(entry, arg)) != 0) break; } if (ferror(fp)) ret = -1; fclose(fp); return (ret); } #else int intf_loop(intf_t *intf, intf_handler callback, void *arg) { struct intf_entry *entry; struct ifreq *ifr, *lifr, *pifr; char *p, ebuf[BUFSIZ]; int ret; entry = (struct intf_entry *)ebuf; intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); pifr = NULL; lifr = (struct ifreq *)&intf->ifc.ifc_buf[intf->ifc.ifc_len]; for (ifr = intf->ifc.ifc_req; ifr < lifr; ifr = NEXTIFR(ifr)) { /* XXX - Linux, Solaris ifaliases */ if ((p = strchr(ifr->ifr_name, ':')) != NULL) *p = '\0'; if (pifr != NULL && strcmp(ifr->ifr_name, pifr->ifr_name) == 0) continue; memset(ebuf, 0, sizeof(ebuf)); strlcpy(entry->intf_name, ifr->ifr_name, sizeof(entry->intf_name)); entry->intf_len = sizeof(ebuf); if (_intf_get_noalias(intf, entry) < 0) return (-1); if (_intf_get_aliases(intf, entry) < 0) return (-1); if ((ret = (*callback)(entry, arg)) != 0) return (ret); pifr = ifr; } return (0); } #endif /* !HAVE_LINUX_PROCFS */ intf_t * intf_close(intf_t *intf) { if (intf != NULL) { if (intf->fd >= 0) close(intf->fd); if (intf->fd6 >= 0) close(intf->fd6); free(intf); } return (NULL); } libdnet-1.12/src/ip-cooked.c0000644000076500007650000001242510175535200017035 0ustar dugsongdugsong00000000000000/* * ip-cooked.c * * Copyright (c) 2001 Dug Song * * $Id: ip-cooked.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #ifndef _WIN32 #include #include #endif #include #include #include #include #include "dnet.h" #include "queue.h" struct ip_intf { eth_t *eth; char name[INTF_NAME_LEN]; struct addr ha; struct addr pa; int mtu; LIST_ENTRY(ip_intf) next; }; struct ip_handle { arp_t *arp; intf_t *intf; route_t *route; int fd; struct sockaddr_in sin; LIST_HEAD(, ip_intf) ip_intf_list; }; static int _add_ip_intf(const struct intf_entry *entry, void *arg) { ip_t *ip = (ip_t *)arg; struct ip_intf *ipi; if (entry->intf_type == INTF_TYPE_ETH && (entry->intf_flags & INTF_FLAG_UP) != 0 && entry->intf_mtu >= ETH_LEN_MIN && entry->intf_addr.addr_type == ADDR_TYPE_IP && entry->intf_link_addr.addr_type == ADDR_TYPE_ETH) { if ((ipi = calloc(1, sizeof(*ipi))) == NULL) return (-1); strlcpy(ipi->name, entry->intf_name, sizeof(ipi->name)); memcpy(&ipi->ha, &entry->intf_link_addr, sizeof(ipi->ha)); memcpy(&ipi->pa, &entry->intf_addr, sizeof(ipi->pa)); ipi->mtu = entry->intf_mtu; LIST_INSERT_HEAD(&ip->ip_intf_list, ipi, next); } return (0); } ip_t * ip_open(void) { ip_t *ip; if ((ip = calloc(1, sizeof(*ip))) != NULL) { ip->fd = -1; if ((ip->arp = arp_open()) == NULL || (ip->intf = intf_open()) == NULL || (ip->route = route_open()) == NULL) return (ip_close(ip)); if ((ip->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (ip_close(ip)); memset(&ip->sin, 0, sizeof(ip->sin)); ip->sin.sin_family = AF_INET; ip->sin.sin_port = htons(666); LIST_INIT(&ip->ip_intf_list); if (intf_loop(ip->intf, _add_ip_intf, ip) != 0) return (ip_close(ip)); } return (ip); } static struct ip_intf * _lookup_ip_intf(ip_t *ip, ip_addr_t dst) { struct ip_intf *ipi; int n; ip->sin.sin_addr.s_addr = dst; n = sizeof(ip->sin); if (connect(ip->fd, (struct sockaddr *)&ip->sin, n) < 0) return (NULL); if (getsockname(ip->fd, (struct sockaddr *)&ip->sin, &n) < 0) return (NULL); LIST_FOREACH(ipi, &ip->ip_intf_list, next) { if (ipi->pa.addr_ip == ip->sin.sin_addr.s_addr) { if (ipi->eth == NULL) { if ((ipi->eth = eth_open(ipi->name)) == NULL) return (NULL); } if (ipi != LIST_FIRST(&ip->ip_intf_list)) { LIST_REMOVE(ipi, next); LIST_INSERT_HEAD(&ip->ip_intf_list, ipi, next); } return (ipi); } } return (NULL); } static void _request_arp(struct ip_intf *ipi, struct addr *dst) { u_char frame[ETH_HDR_LEN + ARP_HDR_LEN + ARP_ETHIP_LEN]; eth_pack_hdr(frame, ETH_ADDR_BROADCAST, ipi->ha.addr_eth, ETH_TYPE_ARP); arp_pack_hdr_ethip(frame + ETH_HDR_LEN, ARP_OP_REQUEST, ipi->ha.addr_eth, ipi->pa.addr_ip, ETH_ADDR_BROADCAST, dst->addr_ip); eth_send(ipi->eth, frame, sizeof(frame)); } ssize_t ip_send(ip_t *ip, const void *buf, size_t len) { struct ip_hdr *iph; struct ip_intf *ipi; struct arp_entry arpent; struct route_entry rtent; u_char frame[ETH_LEN_MAX]; int i, usec; iph = (struct ip_hdr *)buf; if ((ipi = _lookup_ip_intf(ip, iph->ip_dst)) == NULL) { errno = EHOSTUNREACH; return (-1); } arpent.arp_pa.addr_type = ADDR_TYPE_IP; arpent.arp_pa.addr_bits = IP_ADDR_BITS; arpent.arp_pa.addr_ip = iph->ip_dst; memcpy(&rtent.route_dst, &arpent.arp_pa, sizeof(rtent.route_dst)); for (i = 0, usec = 10; i < 3; i++, usec *= 100) { if (arp_get(ip->arp, &arpent) == 0) break; if (route_get(ip->route, &rtent) == 0 && rtent.route_gw.addr_ip != ipi->pa.addr_ip) { memcpy(&arpent.arp_pa, &rtent.route_gw, sizeof(arpent.arp_pa)); if (arp_get(ip->arp, &arpent) == 0) break; } _request_arp(ipi, &arpent.arp_pa); usleep(usec); } if (i == 3) memset(&arpent.arp_ha.addr_eth, 0xff, ETH_ADDR_LEN); eth_pack_hdr(frame, arpent.arp_ha.addr_eth, ipi->ha.addr_eth, ETH_TYPE_IP); if (len > ipi->mtu) { u_char *p, *start, *end, *ip_data; int ip_hl, fraglen; ip_hl = iph->ip_hl << 2; fraglen = ipi->mtu - ip_hl; iph = (struct ip_hdr *)(frame + ETH_HDR_LEN); memcpy(iph, buf, ip_hl); ip_data = (u_char *)iph + ip_hl; start = (u_char *)buf + ip_hl; end = (u_char *)buf + len; for (p = start; p < end; ) { memcpy(ip_data, p, fraglen); iph->ip_len = htons(ip_hl + fraglen); iph->ip_off = htons(((p + fraglen < end) ? IP_MF : 0) | ((p - start) >> 3)); ip_checksum(iph, ip_hl + fraglen); i = ETH_HDR_LEN + ip_hl + fraglen; if (eth_send(ipi->eth, frame, i) != i) return (-1); p += fraglen; if (end - p < fraglen) fraglen = end - p; } return (len); } memcpy(frame + ETH_HDR_LEN, buf, len); i = ETH_HDR_LEN + len; if (eth_send(ipi->eth, frame, i) != i) return (-1); return (len); } ip_t * ip_close(ip_t *ip) { struct ip_intf *ipi, *nxt; if (ip != NULL) { for (ipi = LIST_FIRST(&ip->ip_intf_list); ipi != LIST_END(&ip->ip_intf_list); ipi = nxt) { nxt = LIST_NEXT(ipi, next); if (ipi->eth != NULL) eth_close(ipi->eth); free(ipi); } if (ip->fd >= 0) close(ip->fd); if (ip->route != NULL) route_close(ip->route); if (ip->intf != NULL) intf_close(ip->intf); if (ip->arp != NULL) arp_close(ip->arp); free(ip); } return (NULL); } libdnet-1.12/src/ip-util.c0000644000076500007650000000715210205003674016546 0ustar dugsongdugsong00000000000000/* * ip-util.c * * Copyright (c) 2002 Dug Song * * $Id: ip-util.c 595 2005-02-17 02:55:56Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" ssize_t ip_add_option(void *buf, size_t len, int proto, const void *optbuf, size_t optlen) { struct ip_hdr *ip; struct tcp_hdr *tcp = NULL; u_char *p; int hl, datalen, padlen; if (proto != IP_PROTO_IP && proto != IP_PROTO_TCP) { errno = EINVAL; return (-1); } ip = (struct ip_hdr *)buf; hl = ip->ip_hl << 2; p = (u_char *)buf + hl; if (proto == IP_PROTO_TCP) { tcp = (struct tcp_hdr *)p; hl = tcp->th_off << 2; p = (u_char *)tcp + hl; } datalen = ntohs(ip->ip_len) - (p - (u_char *)buf); /* Compute padding to next word boundary. */ if ((padlen = 4 - (optlen % 4)) == 4) padlen = 0; /* XXX - IP_HDR_LEN_MAX == TCP_HDR_LEN_MAX */ if (hl + optlen + padlen > IP_HDR_LEN_MAX || ntohs(ip->ip_len) + optlen + padlen > len) { errno = EINVAL; return (-1); } /* XXX - IP_OPT_TYPEONLY() == TCP_OPT_TYPEONLY */ if (IP_OPT_TYPEONLY(((struct ip_opt *)optbuf)->opt_type)) optlen = 1; /* Shift any existing data. */ if (datalen) { memmove(p + optlen + padlen, p, datalen); } /* XXX - IP_OPT_NOP == TCP_OPT_NOP */ if (padlen) { memset(p, IP_OPT_NOP, padlen); p += padlen; } memmove(p, optbuf, optlen); p += optlen; optlen += padlen; if (proto == IP_PROTO_IP) ip->ip_hl = (p - (u_char *)ip) >> 2; else if (proto == IP_PROTO_TCP) tcp->th_off = (p - (u_char *)tcp) >> 2; ip->ip_len = htons(ntohs(ip->ip_len) + optlen); return (optlen); } void ip_checksum(void *buf, size_t len) { struct ip_hdr *ip; int hl, off, sum; if (len < IP_HDR_LEN) return; ip = (struct ip_hdr *)buf; hl = ip->ip_hl << 2; ip->ip_sum = 0; sum = ip_cksum_add(ip, hl, 0); ip->ip_sum = ip_cksum_carry(sum); off = htons(ip->ip_off); if ((off & IP_OFFMASK) != 0 || (off & IP_MF) != 0) return; len -= hl; if (ip->ip_p == IP_PROTO_TCP) { struct tcp_hdr *tcp = (struct tcp_hdr *)((u_char *)ip + hl); if (len >= TCP_HDR_LEN) { tcp->th_sum = 0; sum = ip_cksum_add(tcp, len, 0) + htons(ip->ip_p + len); sum = ip_cksum_add(&ip->ip_src, 8, sum); tcp->th_sum = ip_cksum_carry(sum); } } else if (ip->ip_p == IP_PROTO_UDP) { struct udp_hdr *udp = (struct udp_hdr *)((u_char *)ip + hl); if (len >= UDP_HDR_LEN) { udp->uh_sum = 0; sum = ip_cksum_add(udp, len, 0) + htons(ip->ip_p + len); sum = ip_cksum_add(&ip->ip_src, 8, sum); udp->uh_sum = ip_cksum_carry(sum); if (!udp->uh_sum) udp->uh_sum = 0xffff; /* RFC 768 */ } } else if (ip->ip_p == IP_PROTO_ICMP || ip->ip_p == IP_PROTO_IGMP) { struct icmp_hdr *icmp = (struct icmp_hdr *)((u_char *)ip + hl); if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0); icmp->icmp_cksum = ip_cksum_carry(sum); } } } int ip_cksum_add(const void *buf, size_t len, int cksum) { uint16_t *sp = (uint16_t *)buf; int n, sn; sn = len / 2; n = (sn + 15) / 16; /* XXX - unroll loop using Duff's device. */ switch (sn % 16) { case 0: do { cksum += *sp++; case 15: cksum += *sp++; case 14: cksum += *sp++; case 13: cksum += *sp++; case 12: cksum += *sp++; case 11: cksum += *sp++; case 10: cksum += *sp++; case 9: cksum += *sp++; case 8: cksum += *sp++; case 7: cksum += *sp++; case 6: cksum += *sp++; case 5: cksum += *sp++; case 4: cksum += *sp++; case 3: cksum += *sp++; case 2: cksum += *sp++; case 1: cksum += *sp++; } while (--n > 0); } if (len & 1) cksum += htons(*(u_char *)sp << 8); return (cksum); } libdnet-1.12/src/ip-win32.c0000644000076500007650000000247310175535200016535 0ustar dugsongdugsong00000000000000/* * ip-win32.c * * Copyright (c) 2002 Dug Song * * $Id: ip-win32.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" struct ip_handle { WSADATA wsdata; SOCKET fd; struct sockaddr_in sin; }; ip_t * ip_open(void) { BOOL on; ip_t *ip; if ((ip = calloc(1, sizeof(*ip))) != NULL) { if (WSAStartup(MAKEWORD(2, 2), &ip->wsdata) != 0) { free(ip); return (NULL); } if ((ip->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == INVALID_SOCKET) return (ip_close(ip)); on = TRUE; if (setsockopt(ip->fd, IPPROTO_IP, IP_HDRINCL, (const char *)&on, sizeof(on)) == SOCKET_ERROR) { SetLastError(ERROR_NETWORK_ACCESS_DENIED); return (ip_close(ip)); } ip->sin.sin_family = AF_INET; ip->sin.sin_port = htons(666); } return (ip); } ssize_t ip_send(ip_t *ip, const void *buf, size_t len) { struct ip_hdr *hdr = (struct ip_hdr *)buf; ip->sin.sin_addr.s_addr = hdr->ip_src; if ((len = sendto(ip->fd, (const char *)buf, len, 0, (struct sockaddr *)&ip->sin, sizeof(ip->sin))) != SOCKET_ERROR) return (len); return (-1); } ip_t * ip_close(ip_t *ip) { if (ip != NULL) { WSACleanup(); if (ip->fd != INVALID_SOCKET) closesocket(ip->fd); free(ip); } return (NULL); } libdnet-1.12/src/ip.c0000644000076500007650000000346010175535200015572 0ustar dugsongdugsong00000000000000/* * ip.c * * Copyright (c) 2000 Dug Song * * $Id: ip.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" struct ip_handle { int fd; }; ip_t * ip_open(void) { ip_t *i; int n, len; if ((i = calloc(1, sizeof(*i))) == NULL) return (NULL); if ((i->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) return (ip_close(i)); #ifdef IP_HDRINCL n = 1; if (setsockopt(i->fd, IPPROTO_IP, IP_HDRINCL, &n, sizeof(n)) < 0) return (ip_close(i)); #endif #ifdef SO_SNDBUF len = sizeof(n); if (getsockopt(i->fd, SOL_SOCKET, SO_SNDBUF, &n, &len) < 0) return (ip_close(i)); for (n += 128; n < 1048576; n += 128) { if (setsockopt(i->fd, SOL_SOCKET, SO_SNDBUF, &n, len) < 0) { if (errno == ENOBUFS) break; return (ip_close(i)); } } #endif #ifdef SO_BROADCAST n = 1; if (setsockopt(i->fd, SOL_SOCKET, SO_BROADCAST, &n, sizeof(n)) < 0) return (ip_close(i)); #endif return (i); } ssize_t ip_send(ip_t *i, const void *buf, size_t len) { struct ip_hdr *ip; struct sockaddr_in sin; ip = (struct ip_hdr *)buf; memset(&sin, 0, sizeof(sin)); #ifdef HAVE_SOCKADDR_SA_LEN sin.sin_len = sizeof(sin); #endif sin.sin_family = AF_INET; sin.sin_addr.s_addr = ip->ip_dst; #ifdef HAVE_RAWIP_HOST_OFFLEN ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); len = sendto(i->fd, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)); ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); return (len); #else return (sendto(i->fd, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin))); #endif } ip_t * ip_close(ip_t *i) { if (i != NULL) { if (i->fd >= 0) close(i->fd); free(i); } return (NULL); } libdnet-1.12/src/ip6.c0000644000076500007650000000342310174652026015664 0ustar dugsongdugsong00000000000000/* * ip6.c * * Copyright (c) 2002 Dug Song * * $Id: ip6.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include "dnet.h" #define IP6_IS_EXT(n) \ ((n) == IP_PROTO_HOPOPTS || (n) == IP_PROTO_DSTOPTS || \ (n) == IP_PROTO_ROUTING || (n) == IP_PROTO_FRAGMENT) void ip6_checksum(void *buf, size_t len) { struct ip6_hdr *ip6 = (struct ip6_hdr *)buf; struct ip6_ext_hdr *ext; u_char *p, nxt; int i, sum; nxt = ip6->ip6_nxt; for (i = IP6_HDR_LEN; IP6_IS_EXT(nxt); i += (ext->ext_len + 1) << 3) { if (i >= (int)len) return; ext = (struct ip6_ext_hdr *)((u_char *)buf + i); nxt = ext->ext_nxt; } p = (u_char *)buf + i; len -= i; if (nxt == IP_PROTO_TCP) { struct tcp_hdr *tcp = (struct tcp_hdr *)p; if (len >= TCP_HDR_LEN) { tcp->th_sum = 0; sum = ip_cksum_add(tcp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); tcp->th_sum = ip_cksum_carry(sum); } } else if (nxt == IP_PROTO_UDP) { struct udp_hdr *udp = (struct udp_hdr *)p; if (len >= UDP_HDR_LEN) { udp->uh_sum = 0; sum = ip_cksum_add(udp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); if ((udp->uh_sum = ip_cksum_carry(sum)) == 0) udp->uh_sum = 0xffff; } } else if (nxt == IP_PROTO_ICMPV6) { struct icmp_hdr *icmp = (struct icmp_hdr *)p; if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); icmp->icmp_cksum = ip_cksum_carry(sum); } } else if (nxt == IP_PROTO_ICMP || nxt == IP_PROTO_IGMP) { struct icmp_hdr *icmp = (struct icmp_hdr *)p; if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0); icmp->icmp_cksum = ip_cksum_carry(sum); } } } libdnet-1.12/src/Makefile.am0000644000076500007650000000042110363626565017062 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 625 2006-01-19 06:11:01Z dugsong $ include $(top_srcdir)/Makefile.am.common lib_LTLIBRARIES = libdnet.la libdnet_la_SOURCES = addr-util.c addr.c blob.c ip-util.c ip6.c rand.c libdnet_la_LIBADD = @LTLIBOBJS@ libdnet_la_LDFLAGS = -version-info 1:1:0 libdnet-1.12/src/Makefile.in0000644000076500007650000002372210363627052017074 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = libdnet.la libdnet_la_SOURCES = addr-util.c addr.c blob.c ip-util.c ip6.c rand.c libdnet_la_LIBADD = @LTLIBOBJS@ libdnet_la_LDFLAGS = -version-info 1:1:0 subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libdnet_la_DEPENDENCIES = @LTLIBOBJS@ am_libdnet_la_OBJECTS = addr-util.lo addr.lo blob.lo ip-util.lo ip6.lo \ rand.lo libdnet_la_OBJECTS = $(am_libdnet_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libdnet_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in arp-bsd.c arp-ioctl.c arp-none.c \ arp-win32.c err.c eth-bsd.c eth-dlpi.c eth-linux.c eth-ndd.c \ eth-none.c eth-pfilt.c eth-snoop.c eth-win32.c fw-ipchains.c \ fw-ipf.c fw-ipfw.c fw-none.c fw-pf.c fw-pktfilter.c \ intf-win32.c intf.c ip-cooked.c ip-win32.c ip.c memcmp.c \ route-bsd.c route-hpux.c route-linux.c route-none.c \ route-win32.c strlcat.c strlcpy.c strsep.c tun-bsd.c \ tun-linux.c tun-none.c tun-solaris.c SOURCES = $(libdnet_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdnet.la: $(libdnet_la_OBJECTS) $(libdnet_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libdnet_la_LDFLAGS) $(libdnet_la_OBJECTS) $(libdnet_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ tags uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES # 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: libdnet-1.12/src/memcmp.c0000644000076500007650000000445207361216262016451 0ustar dugsongdugsong00000000000000/*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: memcmp.c,v 1.2 1996/08/19 08:34:05 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include /* * Compare memory regions. */ int memcmp(s1, s2, n) const void *s1, *s2; size_t n; { if (n != 0) { register const unsigned char *p1 = s1, *p2 = s2; do { if (*p1++ != *p2++) return (*--p1 - *--p2); } while (--n != 0); } return (0); } libdnet-1.12/src/rand.c0000644000076500007650000000702410204314223016077 0ustar dugsongdugsong00000000000000/* * rand.c * * Pseudorandom number generation, based on OpenBSD arc4random(). * * Copyright (c) 2000 Dug Song * Copyright (c) 1996 David Mazieres * * $Id: rand.c 587 2005-02-15 06:37:07Z dugsong $ */ #include "config.h" #ifdef _WIN32 /* XXX */ # undef _WIN32_WINNT # define _WIN32_WINNT 0x0400 # include # define inline __inline #else # include # include # include #endif #include #include #include #include "dnet.h" struct rand_handle { uint8_t i; uint8_t j; uint8_t s[256]; u_char *tmp; int tmplen; }; static inline void rand_init(rand_t *rand) { int i; for (i = 0; i < 256; i++) rand->s[i] = i; rand->i = rand->j = 0; } static inline void rand_addrandom(rand_t *rand, u_char *buf, int len) { int i; uint8_t si; rand->i--; for (i = 0; i < 256; i++) { rand->i = (rand->i + 1); si = rand->s[rand->i]; rand->j = (rand->j + si + buf[i % len]); rand->s[rand->i] = rand->s[rand->j]; rand->s[rand->j] = si; } rand->j = rand->i; } rand_t * rand_open(void) { rand_t *r; u_char seed[256]; #ifdef _WIN32 HCRYPTPROV hcrypt = 0; CryptAcquireContext(&hcrypt, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); CryptGenRandom(hcrypt, sizeof(seed), seed); CryptReleaseContext(hcrypt, 0); #else struct timeval *tv = (struct timeval *)seed; int fd; if ((fd = open("/dev/arandom", O_RDONLY)) != -1 || (fd = open("/dev/urandom", O_RDONLY)) != -1) { read(fd, seed + sizeof(*tv), sizeof(seed) - sizeof(*tv)); close(fd); } gettimeofday(tv, NULL); #endif if ((r = malloc(sizeof(*r))) != NULL) { rand_init(r); rand_addrandom(r, seed, 128); rand_addrandom(r, seed + 128, 128); r->tmp = NULL; r->tmplen = 0; } return (r); } static uint8_t rand_getbyte(rand_t *r) { uint8_t si, sj; r->i = (r->i + 1); si = r->s[r->i]; r->j = (r->j + si); sj = r->s[r->j]; r->s[r->i] = sj; r->s[r->j] = si; return (r->s[(si + sj) & 0xff]); } int rand_get(rand_t *r, void *buf, size_t len) { u_char *p; u_int i; for (p = buf, i = 0; i < len; i++) { p[i] = rand_getbyte(r); } return (0); } int rand_set(rand_t *r, const void *buf, size_t len) { rand_init(r); rand_addrandom(r, (u_char *)buf, len); rand_addrandom(r, (u_char *)buf, len); return (0); } int rand_add(rand_t *r, const void *buf, size_t len) { rand_addrandom(r, (u_char *)buf, len); return (0); } uint8_t rand_uint8(rand_t *r) { return (rand_getbyte(r)); } uint16_t rand_uint16(rand_t *r) { uint16_t val; val = rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } uint32_t rand_uint32(rand_t *r) { uint32_t val; val = rand_getbyte(r) << 24; val |= rand_getbyte(r) << 16; val |= rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } int rand_shuffle(rand_t *r, void *base, size_t nmemb, size_t size) { u_char *save, *src, *dst, *start = (u_char *)base; u_int i, j; if (nmemb < 2) return (0); if ((u_int)r->tmplen < size) { if (r->tmp == NULL) { if ((save = malloc(size)) == NULL) return (-1); } else if ((save = realloc(r->tmp, size)) == NULL) return (-1); r->tmp = save; r->tmplen = size; } else save = r->tmp; for (i = 0; i < nmemb; i++) { if ((j = rand_uint32(r) % (nmemb - 1)) != i) { src = start + (size * i); dst = start + (size * j); memcpy(save, dst, size); memcpy(dst, src, size); memcpy(src, save, size); } } return (0); } rand_t * rand_close(rand_t *r) { if (r != NULL) { if (r->tmp != NULL) free(r->tmp); free(r); } return (NULL); } libdnet-1.12/src/route-bsd.c0000644000076500007650000002567710202567256017113 0ustar dugsongdugsong00000000000000/* * route-bsd.c * * Copyright (c) 2001 Dug Song * Copyright (c) 1999 Masaki Hirabaru * * $Id: route-bsd.c 555 2005-02-10 05:18:38Z dugsong $ */ #include "config.h" #include #include #include #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_STREAMS_MIB2 #include #include #include #include #include #include #undef IP_ADDR_LEN #include #elif defined(HAVE_STREAMS_ROUTE) #include #include #endif #define route_t oroute_t /* XXX - unixware */ #include #undef route_t #include #include #include #include #include #include #include #include "dnet.h" #define ROUNDUP(a) \ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #ifdef HAVE_SOCKADDR_SA_LEN #define NEXTSA(s) \ ((struct sockaddr *)((u_char *)(s) + ROUNDUP((s)->sa_len))) #else #define NEXTSA(s) \ ((struct sockaddr *)((u_char *)(s) + ROUNDUP(sizeof(*(s))))) #endif struct route_handle { int fd; int seq; #ifdef HAVE_STREAMS_MIB2 int ip_fd; #endif }; #ifdef DEBUG static void route_msg_print(struct rt_msghdr *rtm) { printf("v: %d type: 0x%x flags: 0x%x addrs: 0x%x pid: %d seq: %d\n", rtm->rtm_version, rtm->rtm_type, rtm->rtm_flags, rtm->rtm_addrs, rtm->rtm_pid, rtm->rtm_seq); } #endif static int route_msg(route_t *r, int type, struct addr *dst, struct addr *gw) { struct addr net; struct rt_msghdr *rtm; struct sockaddr *sa; u_char buf[BUFSIZ]; pid_t pid; int len; memset(buf, 0, sizeof(buf)); rtm = (struct rt_msghdr *)buf; rtm->rtm_version = RTM_VERSION; if ((rtm->rtm_type = type) != RTM_DELETE) rtm->rtm_flags = RTF_UP; rtm->rtm_addrs = RTA_DST; rtm->rtm_seq = ++r->seq; /* Destination */ sa = (struct sockaddr *)(rtm + 1); if (addr_net(dst, &net) < 0 || addr_ntos(&net, sa) < 0) return (-1); sa = NEXTSA(sa); /* Gateway */ if (gw != NULL && type != RTM_GET) { rtm->rtm_flags |= RTF_GATEWAY; rtm->rtm_addrs |= RTA_GATEWAY; if (addr_ntos(gw, sa) < 0) return (-1); sa = NEXTSA(sa); } /* Netmask */ if (dst->addr_ip == IP_ADDR_ANY || dst->addr_bits < IP_ADDR_BITS) { rtm->rtm_addrs |= RTA_NETMASK; if (addr_btos(dst->addr_bits, sa) < 0) return (-1); sa = NEXTSA(sa); } else rtm->rtm_flags |= RTF_HOST; rtm->rtm_msglen = (u_char *)sa - buf; #ifdef DEBUG route_msg_print(rtm); #endif #ifdef HAVE_STREAMS_ROUTE if (ioctl(r->fd, RTSTR_SEND, rtm) < 0) return (-1); #else if (write(r->fd, buf, rtm->rtm_msglen) < 0) return (-1); pid = getpid(); while (type == RTM_GET && (len = read(r->fd, buf, sizeof(buf))) > 0) { if (len < (int)sizeof(*rtm)) { return (-1); } if (rtm->rtm_type == type && rtm->rtm_pid == pid && rtm->rtm_seq == r->seq) { if (rtm->rtm_errno) { errno = rtm->rtm_errno; return (-1); } break; } } #endif if (type == RTM_GET && (rtm->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) { sa = (struct sockaddr *)(rtm + 1); sa = NEXTSA(sa); if (addr_ston(sa, gw) < 0 || gw->addr_type != ADDR_TYPE_IP) { errno = ESRCH; return (-1); } } return (0); } route_t * route_open(void) { route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { r->fd = -1; #ifdef HAVE_STREAMS_MIB2 if ((r->ip_fd = open(IP_DEV_NAME, O_RDWR)) < 0) return (route_close(r)); #endif #ifdef HAVE_STREAMS_ROUTE if ((r->fd = open("/dev/route", O_RDWR, 0)) < 0) #else if ((r->fd = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) #endif return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct route_entry rtent; memcpy(&rtent, entry, sizeof(rtent)); if (route_msg(r, RTM_ADD, &rtent.route_dst, &rtent.route_gw) < 0) return (-1); return (0); } int route_delete(route_t *r, const struct route_entry *entry) { struct route_entry rtent; memcpy(&rtent, entry, sizeof(rtent)); if (route_get(r, &rtent) < 0) return (-1); if (route_msg(r, RTM_DELETE, &rtent.route_dst, &rtent.route_gw) < 0) return (-1); return (0); } int route_get(route_t *r, struct route_entry *entry) { if (route_msg(r, RTM_GET, &entry->route_dst, &entry->route_gw) < 0) return (-1); return (0); } #if defined(HAVE_SYS_SYSCTL_H) || defined(HAVE_STREAMS_ROUTE) int route_loop(route_t *r, route_handler callback, void *arg) { struct rt_msghdr *rtm; struct route_entry entry; struct sockaddr *sa; char *buf, *lim, *next; int ret; #ifdef HAVE_SYS_SYSCTL_H int mib[6] = { CTL_NET, PF_ROUTE, 0, 0 /* XXX */, NET_RT_DUMP, 0 }; size_t len; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if (len == 0) return (0); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } lim = buf + len; next = buf; #else /* HAVE_STREAMS_ROUTE */ struct rt_giarg giarg, *gp; memset(&giarg, 0, sizeof(giarg)); giarg.gi_op = KINFO_RT_DUMP; if (ioctl(r->fd, RTSTR_GETROUTE, &giarg) < 0) return (-1); if ((buf = malloc(giarg.gi_size)) == NULL) return (-1); gp = (struct rt_giarg *)buf; gp->gi_size = giarg.gi_size; gp->gi_op = KINFO_RT_DUMP; gp->gi_where = buf; gp->gi_arg = RTF_UP | RTF_GATEWAY; if (ioctl(r->fd, RTSTR_GETROUTE, buf) < 0) { free(buf); return (-1); } lim = buf + gp->gi_size; next = buf + sizeof(giarg); #endif for (ret = 0; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; sa = (struct sockaddr *)(rtm + 1); if (addr_ston(sa, &entry.route_dst) < 0 || (rtm->rtm_addrs & RTA_GATEWAY) == 0) continue; sa = NEXTSA(sa); if (addr_ston(sa, &entry.route_gw) < 0) continue; if (entry.route_dst.addr_type != entry.route_gw.addr_type || (entry.route_dst.addr_type != ADDR_TYPE_IP && entry.route_dst.addr_type != ADDR_TYPE_IP6)) continue; if (rtm->rtm_addrs & RTA_NETMASK) { sa = NEXTSA(sa); if (addr_stob(sa, &entry.route_dst.addr_bits) < 0) continue; } if ((ret = callback(&entry, arg)) != 0) break; } free(buf); return (ret); } #elif defined(HAVE_STREAMS_MIB2) #ifdef IRE_DEFAULT /* This means Solaris 5.6 */ /* I'm not sure if they are compatible, though -- masaki */ #define IRE_ROUTE IRE_CACHE #define IRE_ROUTE_REDIRECT IRE_HOST_REDIRECT #endif /* IRE_DEFAULT */ int route_loop(route_t *r, route_handler callback, void *arg) { struct route_entry entry; struct sockaddr_in sin; struct strbuf msg; struct T_optmgmt_req *tor; struct T_optmgmt_ack *toa; struct T_error_ack *tea; struct opthdr *opt; mib2_ipRouteEntry_t *rt, *rtend; u_char buf[8192]; int flags, rc, rtable, ret; tor = (struct T_optmgmt_req *)buf; toa = (struct T_optmgmt_ack *)buf; tea = (struct T_error_ack *)buf; tor->PRIM_type = T_OPTMGMT_REQ; tor->OPT_offset = sizeof(*tor); tor->OPT_length = sizeof(*opt); tor->MGMT_flags = T_CURRENT; opt = (struct opthdr *)(tor + 1); opt->level = MIB2_IP; opt->name = opt->len = 0; msg.maxlen = sizeof(buf); msg.len = sizeof(*tor) + sizeof(*opt); msg.buf = buf; if (putmsg(r->ip_fd, &msg, NULL, 0) < 0) return (-1); opt = (struct opthdr *)(toa + 1); msg.maxlen = sizeof(buf); for (;;) { flags = 0; if ((rc = getmsg(r->ip_fd, &msg, NULL, &flags)) < 0) return (-1); /* See if we're finished. */ if (rc == 0 && msg.len >= sizeof(*toa) && toa->PRIM_type == T_OPTMGMT_ACK && toa->MGMT_flags == T_SUCCESS && opt->len == 0) break; if (msg.len >= sizeof(*tea) && tea->PRIM_type == T_ERROR_ACK) return (-1); if (rc != MOREDATA || msg.len < (int)sizeof(*toa) || toa->PRIM_type != T_OPTMGMT_ACK || toa->MGMT_flags != T_SUCCESS) return (-1); rtable = (opt->level == MIB2_IP && opt->name == MIB2_IP_21); msg.maxlen = sizeof(buf) - (sizeof(buf) % sizeof(*rt)); msg.len = 0; flags = 0; do { rc = getmsg(r->ip_fd, NULL, &msg, &flags); if (rc != 0 && rc != MOREDATA) return (-1); if (!rtable) continue; rt = (mib2_ipRouteEntry_t *)msg.buf; rtend = (mib2_ipRouteEntry_t *)(msg.buf + msg.len); sin.sin_family = AF_INET; for ( ; rt < rtend; rt++) { if ((rt->ipRouteInfo.re_ire_type & (IRE_BROADCAST|IRE_ROUTE_REDIRECT| IRE_LOCAL|IRE_ROUTE)) != 0 || rt->ipRouteNextHop == IP_ADDR_ANY) continue; sin.sin_addr.s_addr = rt->ipRouteNextHop; addr_ston((struct sockaddr *)&sin, &entry.route_gw); sin.sin_addr.s_addr = rt->ipRouteDest; addr_ston((struct sockaddr *)&sin, &entry.route_dst); sin.sin_addr.s_addr = rt->ipRouteMask; addr_stob((struct sockaddr *)&sin, &entry.route_dst.addr_bits); if ((ret = callback(&entry, arg)) != 0) return (ret); } } while (rc == MOREDATA); } return (0); } #elif defined(HAVE_NET_RADIX_H) /* XXX - Tru64, others? */ #include static int _kread(int fd, void *addr, void *buf, int len) { if (lseek(fd, (off_t)addr, SEEK_SET) == (off_t)-1L) return (-1); return (read(fd, buf, len) == len ? 0 : -1); } static int _radix_walk(int fd, struct radix_node *rn, route_handler callback, void *arg) { struct radix_node rnode; struct rtentry rt; struct sockaddr_in sin; struct route_entry entry; int ret = 0; again: _kread(fd, rn, &rnode, sizeof(rnode)); if (rnode.rn_b < 0) { if (!(rnode.rn_flags & RNF_ROOT)) { _kread(fd, rn, &rt, sizeof(rt)); _kread(fd, rt_key(&rt), &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.route_dst); if (!(rt.rt_flags & RTF_HOST)) { _kread(fd, rt_mask(&rt), &sin, sizeof(sin)); addr_stob((struct sockaddr *)&sin, &entry.route_dst.addr_bits); } _kread(fd, rt.rt_gateway, &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.route_gw); if ((ret = callback(&entry, arg)) != 0) return (ret); } if ((rn = rnode.rn_dupedkey)) goto again; } else { rn = rnode.rn_r; if ((ret = _radix_walk(fd, rnode.rn_l, callback, arg)) != 0) return (ret); if ((ret = _radix_walk(fd, rn, callback, arg)) != 0) return (ret); } return (ret); } int route_loop(route_t *r, route_handler callback, void *arg) { struct radix_node_head *rnh, head; struct nlist nl[2]; int fd, ret = 0; memset(nl, 0, sizeof(nl)); nl[0].n_name = "radix_node_head"; if (knlist(nl) < 0 || nl[0].n_type == 0 || (fd = open("/dev/kmem", O_RDONLY, 0)) < 0) return (-1); for (_kread(fd, (void *)nl[0].n_value, &rnh, sizeof(rnh)); rnh != NULL; rnh = head.rnh_next) { _kread(fd, rnh, &head, sizeof(head)); /* XXX - only IPv4 for now... */ if (head.rnh_af == AF_INET) { if ((ret = _radix_walk(fd, head.rnh_treetop, callback, arg)) != 0) break; } } close(fd); return (ret); } #else int route_loop(route_t *r, route_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif route_t * route_close(route_t *r) { if (r != NULL) { #ifdef HAVE_STREAMS_MIB2 if (r->ip_fd >= 0) close(r->ip_fd); #endif if (r->fd >= 0) close(r->fd); free(r); } return (NULL); } libdnet-1.12/src/route-hpux.c0000644000076500007650000000731510001145373017301 0ustar dugsongdugsong00000000000000/* * route-hpux.c * * Copyright (c) 2000 Dug Song * * $Id: route-hpux.c 483 2004-01-14 04:52:11Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define ADDR_ISHOST(a) (((a)->addr_type == ADDR_TYPE_IP && \ (a)->addr_bits == IP_ADDR_BITS) || \ ((a)->addr_type == ADDR_TYPE_IP6 && \ (a)->addr_bits == IP6_ADDR_BITS)) struct route_handle { int fd; }; route_t * route_open(void) { route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { if ((r->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_ntos(&entry->route_gw, &rt.rt_gateway) < 0 || addr_btom(entry->route_dst.addr_bits, &rt.rt_subnetmask, IP_ADDR_LEN) < 0) return (-1); return (ioctl(r->fd, SIOCADDRT, &rt)); } int route_delete(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_btom(entry->route_dst.addr_bits, &rt.rt_subnetmask, IP_ADDR_LEN) < 0) return (-1); return (ioctl(r->fd, SIOCDELRT, &rt)); } int route_get(route_t *r, struct route_entry *entry) { struct rtreq rtr; memset(&rtr, 0, sizeof(rtr)); /* XXX - gross hack for default route */ if (entry->route_dst.addr_ip == IP_ADDR_ANY) { rtr.rtr_destaddr = htonl(0x60060606); rtr.rtr_subnetmask = 0xffffffff; } else { memcpy(&rtr.rtr_destaddr, &entry->route_dst.addr_ip, IP_ADDR_LEN); if (entry->route_dst.addr_bits < IP_ADDR_BITS) addr_btom(entry->route_dst.addr_bits, &rtr.rtr_subnetmask, IP_ADDR_LEN); } if (ioctl(r->fd, SIOCGRTENTRY, &rtr) < 0) return (-1); if (rtr.rtr_gwayaddr == 0) { errno = ESRCH; return (-1); } entry->route_gw.addr_type = ADDR_TYPE_IP; entry->route_gw.addr_bits = IP_ADDR_BITS; memcpy(&entry->route_gw.addr_ip, &rtr.rtr_gwayaddr, IP_ADDR_LEN); return (0); } #define MAX_RTENTRIES 256 /* XXX */ int route_loop(route_t *r, route_handler callback, void *arg) { struct nmparms nm; struct route_entry entry; mib_ipRouteEnt rtentries[MAX_RTENTRIES]; int fd, i, n, ret; if ((fd = open_mib("/dev/ip", O_RDWR, 0 /* XXX */, 0)) < 0) return (-1); nm.objid = ID_ipRouteTable; nm.buffer = rtentries; n = sizeof(rtentries); nm.len = &n; if (get_mib_info(fd, &nm) < 0) { close_mib(fd); return (-1); } close_mib(fd); entry.route_dst.addr_type = entry.route_gw.addr_type = ADDR_TYPE_IP; entry.route_dst.addr_bits = entry.route_gw.addr_bits = IP_ADDR_BITS; n /= sizeof(*rtentries); ret = 0; for (i = 0; i < n; i++) { if (rtentries[i].Type != NMDIRECT && rtentries[i].Type != NMREMOTE) continue; entry.route_dst.addr_ip = rtentries[i].Dest; addr_mtob(&rtentries[i].Mask, IP_ADDR_LEN, &entry.route_dst.addr_bits); entry.route_gw.addr_ip = rtentries[i].NextHop; if ((ret = callback(&entry, arg)) != 0) break; } return (ret); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->fd >= 0) close(r->fd); free(r); } return (NULL); } libdnet-1.12/src/route-linux.c0000644000076500007650000001437110362375311017463 0ustar dugsongdugsong00000000000000/* * route-linux.c * * Copyright (c) 2000 Dug Song * * $Id: route-linux.c 619 2006-01-15 07:33:29Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define ADDR_ISHOST(a) (((a)->addr_type == ADDR_TYPE_IP && \ (a)->addr_bits == IP_ADDR_BITS) || \ ((a)->addr_type == ADDR_TYPE_IP6 && \ (a)->addr_bits == IP6_ADDR_BITS)) #define PROC_ROUTE_FILE "/proc/net/route" #define PROC_IPV6_ROUTE_FILE "/proc/net/ipv6_route" struct route_handle { int fd; int nlfd; }; route_t * route_open(void) { struct sockaddr_nl snl; route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { r->fd = r->nlfd = -1; if ((r->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (route_close(r)); if ((r->nlfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) return (route_close(r)); memset(&snl, 0, sizeof(snl)); snl.nl_family = AF_NETLINK; if (bind(r->nlfd, (struct sockaddr *)&snl, sizeof(snl)) < 0) return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_ntos(&entry->route_gw, &rt.rt_gateway) < 0 || addr_btos(entry->route_dst.addr_bits, &rt.rt_genmask) < 0) return (-1); return (ioctl(r->fd, SIOCADDRT, &rt)); } int route_delete(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_btos(entry->route_dst.addr_bits, &rt.rt_genmask) < 0) return (-1); return (ioctl(r->fd, SIOCDELRT, &rt)); } int route_get(route_t *r, struct route_entry *entry) { static int seq; struct nlmsghdr *nmsg; struct rtmsg *rmsg; struct rtattr *rta; struct sockaddr_nl snl; struct iovec iov; struct msghdr msg; u_char buf[512]; int i, af, alen; switch (entry->route_dst.addr_type) { case ADDR_TYPE_IP: af = AF_INET; alen = IP_ADDR_LEN; break; case ADDR_TYPE_IP6: af = AF_INET6; alen = IP6_ADDR_LEN; break; default: errno = EINVAL; return (-1); } memset(buf, 0, sizeof(buf)); nmsg = (struct nlmsghdr *)buf; nmsg->nlmsg_len = NLMSG_LENGTH(sizeof(*nmsg)) + RTA_LENGTH(alen); nmsg->nlmsg_flags = NLM_F_REQUEST; nmsg->nlmsg_type = RTM_GETROUTE; nmsg->nlmsg_seq = ++seq; rmsg = (struct rtmsg *)(nmsg + 1); rmsg->rtm_family = af; rmsg->rtm_dst_len = entry->route_dst.addr_bits; rta = RTM_RTA(rmsg); rta->rta_type = RTA_DST; rta->rta_len = RTA_LENGTH(alen); /* XXX - gross hack for default route */ if (af == AF_INET && entry->route_dst.addr_ip == IP_ADDR_ANY) { i = htonl(0x60060606); memcpy(RTA_DATA(rta), &i, alen); } else memcpy(RTA_DATA(rta), entry->route_dst.addr_data8, alen); memset(&snl, 0, sizeof(snl)); snl.nl_family = AF_NETLINK; iov.iov_base = nmsg; iov.iov_len = nmsg->nlmsg_len; memset(&msg, 0, sizeof(msg)); msg.msg_name = &snl; msg.msg_namelen = sizeof(snl); msg.msg_iov = &iov; msg.msg_iovlen = 1; if (sendmsg(r->nlfd, &msg, 0) < 0) return (-1); iov.iov_base = buf; iov.iov_len = sizeof(buf); if ((i = recvmsg(r->nlfd, &msg, 0)) <= 0) return (-1); if (nmsg->nlmsg_len < (int)sizeof(*nmsg) || nmsg->nlmsg_len > i || nmsg->nlmsg_seq != seq) { errno = EINVAL; return (-1); } if (nmsg->nlmsg_type == NLMSG_ERROR) return (-1); i -= NLMSG_LENGTH(sizeof(*nmsg)); while (RTA_OK(rta, i)) { if (rta->rta_type == RTA_GATEWAY) { entry->route_gw.addr_type = entry->route_dst.addr_type; memcpy(entry->route_gw.addr_data8, RTA_DATA(rta), alen); entry->route_gw.addr_bits = alen * 8; return (0); } rta = RTA_NEXT(rta, i); } errno = ESRCH; return (-1); } int route_loop(route_t *r, route_handler callback, void *arg) { FILE *fp; struct route_entry entry; char buf[BUFSIZ]; int ret = 0; if ((fp = fopen(PROC_ROUTE_FILE, "r")) != NULL) { char ifbuf[16]; int i, iflags, refcnt, use, metric, mss, win, irtt; uint32_t mask; while (fgets(buf, sizeof(buf), fp) != NULL) { i = sscanf(buf, "%16s %X %X %X %d %d %d %X %d %d %d\n", ifbuf, &entry.route_dst.addr_ip, &entry.route_gw.addr_ip, &iflags, &refcnt, &use, &metric, &mask, &mss, &win, &irtt); if (i < 10 || !(iflags & RTF_UP)) continue; if (entry.route_gw.addr_ip == IP_ADDR_ANY) continue; entry.route_dst.addr_type = entry.route_gw.addr_type = ADDR_TYPE_IP; if (addr_mtob(&mask, IP_ADDR_LEN, &entry.route_dst.addr_bits) < 0) continue; entry.route_gw.addr_bits = IP_ADDR_BITS; if ((ret = callback(&entry, arg)) != 0) break; } fclose(fp); } if (ret == 0 && (fp = fopen(PROC_IPV6_ROUTE_FILE, "r")) != NULL) { char s[33], d[8][5], n[8][5]; u_int slen, dlen; while (fgets(buf, sizeof(buf), fp) != NULL) { sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x " "%32s %02x %04s%04s%04s%04s%04s%04s%04s%04s ", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], &dlen, s, &slen, n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7]); snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], dlen); addr_aton(buf, &entry.route_dst); snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7], IP6_ADDR_BITS); addr_aton(buf, &entry.route_gw); if ((ret = callback(&entry, arg)) != 0) break; } fclose(fp); } return (ret); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->fd >= 0) close(r->fd); if (r->nlfd >= 0) close(r->nlfd); free(r); } return (NULL); } libdnet-1.12/src/route-none.c0000644000076500007650000000137007427404041017257 0ustar dugsongdugsong00000000000000/* * route-none.c * * Copyright (c) 2000 Dug Song * * $Id: route-none.c 260 2002-02-04 04:03:45Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" route_t * route_open(void) { errno = ENOSYS; return (NULL); } int route_add(route_t *r, const struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_delete(route_t *r, const struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_get(route_t *r, struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_loop(route_t *r, route_handler callback, void *arg) { errno = ENOSYS; return (-1); } route_t * route_close(route_t *r) { return (NULL); } libdnet-1.12/src/route-win32.c0000644000076500007650000000666110204320244017257 0ustar dugsongdugsong00000000000000/* * route-win32.c * * Copyright (c) 2002 Dug Song * * $Id: route-win32.c 589 2005-02-15 07:11:32Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" struct route_handle { MIB_IPFORWARDTABLE *ipftable; }; route_t * route_open(void) { return (calloc(1, sizeof(route_t))); } int route_add(route_t *route, const struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; struct addr net; memset(&ipfrow, 0, sizeof(ipfrow)); if (GetBestInterface(entry->route_gw.addr_ip, &ipfrow.dwForwardIfIndex) != NO_ERROR) return (-1); if (addr_net(&entry->route_dst, &net) < 0 || net.addr_type != ADDR_TYPE_IP) return (-1); ipfrow.dwForwardDest = net.addr_ip; addr_btom(entry->route_dst.addr_bits, &ipfrow.dwForwardMask, IP_ADDR_LEN); ipfrow.dwForwardNextHop = entry->route_gw.addr_ip; ipfrow.dwForwardType = 4; /* XXX - next hop != final dest */ ipfrow.dwForwardProto = 3; /* XXX - MIB_PROTO_NETMGMT */ if (CreateIpForwardEntry(&ipfrow) != NO_ERROR) return (-1); return (0); } int route_delete(route_t *route, const struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; DWORD mask; if (entry->route_dst.addr_type != ADDR_TYPE_IP || GetBestRoute(entry->route_dst.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); addr_btom(entry->route_dst.addr_bits, &mask, IP_ADDR_LEN); if (ipfrow.dwForwardDest != entry->route_dst.addr_ip || ipfrow.dwForwardMask != mask) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } if (DeleteIpForwardEntry(&ipfrow) != NO_ERROR) return (-1); return (0); } int route_get(route_t *route, struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; DWORD mask; if (entry->route_dst.addr_type != ADDR_TYPE_IP || GetBestRoute(entry->route_dst.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); if (ipfrow.dwForwardProto == 2 && /* XXX - MIB_IPPROTO_LOCAL */ (ipfrow.dwForwardNextHop|IP_CLASSA_NET) != (IP_ADDR_LOOPBACK|IP_CLASSA_NET) && !IP_LOCAL_GROUP(ipfrow.dwForwardNextHop)) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } addr_btom(entry->route_dst.addr_bits, &mask, IP_ADDR_LEN); entry->route_gw.addr_type = ADDR_TYPE_IP; entry->route_gw.addr_bits = IP_ADDR_BITS; entry->route_gw.addr_ip = ipfrow.dwForwardNextHop; return (0); } int route_loop(route_t *r, route_handler callback, void *arg) { struct route_entry entry; ULONG len; int i, ret; for (len = sizeof(r->ipftable[0]); ; ) { if (r->ipftable) free(r->ipftable); r->ipftable = malloc(len); ret = GetIpForwardTable(r->ipftable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } entry.route_dst.addr_type = ADDR_TYPE_IP; entry.route_dst.addr_bits = IP_ADDR_BITS; entry.route_gw.addr_type = ADDR_TYPE_IP; entry.route_gw.addr_bits = IP_ADDR_BITS; for (i = 0; i < (int)r->ipftable->dwNumEntries; i++) { entry.route_dst.addr_ip = r->ipftable->table[i].dwForwardDest; addr_mtob(&r->ipftable->table[i].dwForwardMask, IP_ADDR_LEN, &entry.route_dst.addr_bits); entry.route_gw.addr_ip = r->ipftable->table[i].dwForwardNextHop; if ((ret = (*callback)(&entry, arg)) != 0) return (ret); } return (0); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->ipftable != NULL) free(r->ipftable); free(r); } return (NULL); } libdnet-1.12/src/strlcat.c0000644000076500007650000000501707361216262016645 0ustar dugsongdugsong00000000000000/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } libdnet-1.12/src/strlcpy.c0000644000076500007650000000464007361216262016672 0ustar dugsongdugsong00000000000000/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } libdnet-1.12/src/strsep.c0000644000076500007650000000576407776646375016550 0ustar dugsongdugsong00000000000000/* $OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; #else static char *rcsid = "$OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char * strsep(stringp, delim) register char **stringp; register const char *delim; { register char *s; register const char *spanp; register int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } libdnet-1.12/src/tun-bsd.c0000644000076500007650000000537010202771454016544 0ustar dugsongdugsong00000000000000/* * tun-bsd.c * * Copyright (c) 2001 Dug Song * * $Id: tun-bsd.c 573 2005-02-10 23:50:04Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include "dnet.h" struct tun { int fd; intf_t *intf; struct intf_entry save; }; #define MAX_DEVS 16 /* XXX - max number of tunnel devices */ tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { struct intf_entry ifent; tun_t *tun; char dev[128]; int i; if (src->addr_type != ADDR_TYPE_IP || dst->addr_type != ADDR_TYPE_IP || src->addr_bits != IP_ADDR_BITS || dst->addr_bits != IP_ADDR_BITS) { errno = EINVAL; return (NULL); } if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); if ((tun->intf = intf_open()) == NULL) return (tun_close(tun)); memset(&ifent, 0, sizeof(ifent)); ifent.intf_len = sizeof(ifent); for (i = 0; i < MAX_DEVS; i++) { snprintf(dev, sizeof(dev), "/dev/tun%d", i); strlcpy(ifent.intf_name, dev + 5, sizeof(ifent.intf_name)); tun->save = ifent; if ((tun->fd = open(dev, O_RDWR, 0)) != -1 && intf_get(tun->intf, &tun->save) == 0) { route_t *r; struct route_entry entry; ifent.intf_flags = INTF_FLAG_UP|INTF_FLAG_POINTOPOINT; ifent.intf_addr = *src; ifent.intf_dst_addr = *dst; ifent.intf_mtu = mtu; if (intf_set(tun->intf, &ifent) < 0) tun = tun_close(tun); /* XXX - try to ensure our route got set */ if ((r = route_open()) != NULL) { entry.route_dst = *dst; entry.route_gw = *src; route_add(r, &entry); route_close(r); } break; } } if (i == MAX_DEVS) tun = tun_close(tun); return (tun); } const char * tun_name(tun_t *tun) { return (tun->save.intf_name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { #ifdef __OpenBSD__ struct iovec iov[2]; uint32_t af = htonl(AF_INET); iov[0].iov_base = ⁡ iov[0].iov_len = sizeof(af); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (writev(tun->fd, iov, 2)); #else return (write(tun->fd, buf, size)); #endif } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { #ifdef __OpenBSD__ struct iovec iov[2]; uint32_t af; iov[0].iov_base = ⁡ iov[0].iov_len = sizeof(af); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (readv(tun->fd, iov, 2) - sizeof(af)); #else return (read(tun->fd, buf, size)); #endif } tun_t * tun_close(tun_t *tun) { if (tun->fd > 0) close(tun->fd); if (tun->intf != NULL) { /* Restore interface configuration on close. */ intf_set(tun->intf, &tun->save); intf_close(tun->intf); } free(tun); return (NULL); } libdnet-1.12/src/tun-linux.c0000644000076500007650000000404710311162536017127 0ustar dugsongdugsong00000000000000/* * tun-linux.c * * Universal TUN/TAP driver, in Linux 2.4+ * /usr/src/linux/Documentation/networking/tuntap.txt * * Copyright (c) 2001 Dug Song * * $Id: tun-linux.c 612 2005-09-12 02:18:06Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct tun { int fd; intf_t *intf; struct ifreq ifr; }; tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { tun_t *tun; struct intf_entry ifent; if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); if ((tun->fd = open("/dev/net/tun", O_RDWR, 0)) < 0 || (tun->intf = intf_open()) == NULL) return (tun_close(tun)); tun->ifr.ifr_flags = IFF_TUN; if (ioctl(tun->fd, TUNSETIFF, (void *) &tun->ifr) < 0) return (tun_close(tun)); memset(&ifent, 0, sizeof(ifent)); strlcpy(ifent.intf_name, tun->ifr.ifr_name, sizeof(ifent.intf_name)); ifent.intf_flags = INTF_FLAG_UP|INTF_FLAG_POINTOPOINT; ifent.intf_addr = *src; ifent.intf_dst_addr = *dst; ifent.intf_mtu = mtu; if (intf_set(tun->intf, &ifent) < 0) return (tun_close(tun)); return (tun); } const char * tun_name(tun_t *tun) { return (tun->ifr.ifr_name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { struct iovec iov[2]; uint32_t type = ETH_TYPE_IP; iov[0].iov_base = &type; iov[0].iov_len = sizeof(type); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (writev(tun->fd, iov, 2)); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { struct iovec iov[2]; uint32_t type; iov[0].iov_base = &type; iov[0].iov_len = sizeof(type); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (readv(tun->fd, iov, 2) - sizeof(type)); } tun_t * tun_close(tun_t *tun) { if (tun->fd > 0) close(tun->fd); if (tun->intf != NULL) intf_close(tun->intf); free(tun); return (NULL); } libdnet-1.12/src/tun-none.c0000644000076500007650000000132610177074125016732 0ustar dugsongdugsong00000000000000/* * tun-none.c * * Copyright (c) 2001 Dug Song * * $Id: tun-none.c 548 2005-01-30 06:01:57Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { errno = ENOSYS; return (NULL); } const char * tun_name(tun_t *tun) { errno = ENOSYS; return (NULL); } int tun_fileno(tun_t *tun) { errno = ENOSYS; return (-1); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { errno = ENOSYS; return (-1); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { errno = ENOSYS; return (-1); } tun_t * tun_close(tun_t *tun) { return (NULL); } libdnet-1.12/src/tun-solaris.c0000644000076500007650000000431610175535200017443 0ustar dugsongdugsong00000000000000/* * tun-solaris.c * * Universal TUN/TAP driver * * Copyright (c) 2001 Dug Song * * $Id: tun-solaris.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define DEV_TUN "/dev/tun" #define DEV_IP "/dev/ip" struct tun { int fd; int ip_fd; int if_fd; char name[16]; }; tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { tun_t *tun; char cmd[512]; int ppa; if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); tun->fd = tun->ip_fd = tun->if_fd = -1; if ((tun->fd = open(DEV_TUN, O_RDWR, 0)) < 0) return (tun_close(tun)); if ((tun->ip_fd = open(DEV_IP, O_RDWR, 0)) < 0) return (tun_close(tun)); if ((ppa = ioctl(tun->fd, TUNNEWPPA, ppa)) < 0) return (tun_close(tun)); if ((tun->if_fd = open(DEV_TUN, O_RDWR, 0)) < 0) return (tun_close(tun)); if (ioctl(tun->if_fd, I_PUSH, "ip") < 0) return (tun_close(tun)); if (ioctl(tun->if_fd, IF_UNITSEL, (char *)&ppa) < 0) return (tun_close(tun)); if (ioctl(tun->ip_fd, I_LINK, tun->if_fd) < 0) return (tun_close(tun)); snprintf(tun->name, sizeof(tun->name), "tun%d", ppa); snprintf(cmd, sizeof(cmd), "ifconfig %s %s/32 %s mtu %d up", tun->name, addr_ntoa(src), addr_ntoa(dst), mtu); if (system(cmd) < 0) return (tun_close(tun)); return (tun); } const char * tun_name(tun_t *tun) { return (tun->name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { struct strbuf sbuf; sbuf.buf = buf; sbuf.len = size; return (putmsg(tun->fd, NULL, &sbuf, 0) >= 0 ? sbuf.len : -1); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { struct strbuf sbuf; int flags = 0; sbuf.buf = buf; sbuf.maxlen = size; return (getmsg(tun->fd, NULL, &sbuf, &flags) >= 0 ? sbuf.len : -1); } tun_t * tun_close(tun_t *tun) { if (tun->if_fd >= 0) close(tun->if_fd); if (tun->ip_fd >= 0) close(tun->ip_fd); if (tun->fd >= 0) close(tun->fd); free(tun); return (NULL); } libdnet-1.12/test/0000755000076500007650000000000010554406364015214 5ustar dugsongdugsong00000000000000libdnet-1.12/test/check/0000755000076500007650000000000010554406366016273 5ustar dugsongdugsong00000000000000libdnet-1.12/test/check/check_addr.c0000644000076500007650000002343110363372615020506 0ustar dugsongdugsong00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #define ADDR_PACK(a, ip) \ (a)->addr_type = ADDR_TYPE_IP; \ (a)->addr_bits = IP_ADDR_BITS; \ (a)->addr_ip = (ip) #ifdef HAVE_SOCKADDR_SA_LEN #define SIN_PACK(s, ip, port) \ (s)->sin_len = sizeof(struct sockaddr_in); \ (s)->sin_family = AF_INET; \ (s)->sin_port = htons(port); \ (s)->sin_addr.s_addr = (ip) #else #define SIN_PACK(s, ip, port) \ (s)->sin_family = AF_INET; \ (s)->sin_port = htons(port); \ (s)->sin_addr.s_addr = (ip) #endif typedef struct sockaddr SA; START_TEST(test_addr_pack) { struct addr a, b; memset(&a, 0, sizeof(a)); memset(&b, 0, sizeof(b)); ADDR_PACK(&a, 666); addr_pack(&b, ADDR_TYPE_IP, IP_ADDR_BITS, &a.addr_ip, IP_ADDR_LEN); fail_unless(memcmp(&a, &b, sizeof(a)) == 0, "got different address"); } END_TEST START_TEST(test_addr_cmp) { struct addr a, b; ADDR_PACK(&a, 666); memcpy(&b, &a, sizeof(a)); fail_unless(addr_cmp(&a, &b) == 0, "failed on equal addresses"); b.addr_type = ADDR_TYPE_ETH; fail_unless(addr_cmp(&a, &b) != 0, "failed on different addr_type"); memcpy(&b, &a, sizeof(a)); b.addr_bits--; fail_unless(addr_cmp(&a, &b) > 0, "failed on lesser addr_bits"); memcpy(&b, &a, sizeof(a)); b.addr_ip--; fail_unless(addr_cmp(&a, &b) != 0, "failed on different addr_ip"); addr_aton("10.0.0.1", &a); addr_aton("10.0.0.2", &b); fail_unless(addr_cmp(&a, &b) < 0, "failed on lesser addr compare"); fail_unless(addr_cmp(&b, &a) > 0, "failed on greater addr compare"); } END_TEST START_TEST(test_addr_bcast) { struct addr a, b; ADDR_PACK(&a, htonl(0x01020304)); a.addr_bits = 29; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x01020307), "wrong for /29"); a.addr_bits = 16; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x0102ffff), "wrong for /16"); a.addr_bits = 5; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x7ffffff), "wrong for /5"); } END_TEST START_TEST(test_addr_net) { struct addr a, b; ADDR_PACK(&a, htonl(0x01020304)); a.addr_bits = 24; addr_net(&a, &b); fail_unless(b.addr_ip == htonl(0x01020300), "wrong for /24"); addr_aton("cafe:babe::dead:beef", &a); a.addr_bits = 20; addr_net(&a, &b); addr_aton("cafe:b000::", &a); a.addr_bits = IP6_ADDR_BITS; fail_unless(addr_cmp(&a, &b) == 0, "IPv6 net failed"); } END_TEST START_TEST(test_addr_ntop) { struct ntop { u_char *n; char *p; } *ntop, ntop_ip6[] = { { IP6_ADDR_UNSPEC, "::" }, { IP6_ADDR_LOOPBACK, "::1" }, { "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01", "fe08::1" }, { "\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" }, { "\xca\xfe\xba\xbe\x00\x00\x00\x00\x00\x00\x00\x00" "\xde\xad\xbe\xef", "cafe:babe::dead:beef" }, { "\xfe\xed\xfa\xce\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00", "feed:face::" }, { "\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00" "\x0d\x00\x0e\x00\x0f\x00\x00", "0:a:b:c:d:e:f:0" }, { "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xff\xff\x01\x02\x03\x04", "::ffff:1.2.3.4" }, { NULL } }; struct addr a; char buf[64]; ADDR_PACK(&a, htonl(0x010203ff)); a.addr_bits = 23; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255/23") == 0, "bad /23 handling"); a.addr_bits = 0; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255/0") == 0, "bad /0 handling"); a.addr_bits = 32; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255") == 0, "bad /32 handling"); fail_unless(addr_ntop(&a, buf, 9) == NULL, "buffer overflow?"); addr_pack(&a, ADDR_TYPE_ETH, ETH_ADDR_BITS, "\x00\x00\x00\x00\x00\x00", ETH_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), "00:00:00:00:00:00") == 0, "bad empty MAC handling"); memcpy(&a.addr_eth, "\x00\x0d\x0e\x0a\x0d\x00", ETH_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), "00:0d:0e:0a:0d:00") == 0, "b0rked"); a.addr_bits = 16; fail_unless(addr_ntop(&a, buf, sizeof(buf)) == NULL, "took /16 mask"); for (ntop = ntop_ip6; ntop->n != NULL; ntop++) { addr_pack(&a, ADDR_TYPE_IP6, IP6_ADDR_BITS, ntop->n, IP6_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), ntop->p) == 0, ntop->p); } } END_TEST START_TEST(test_addr_pton) { struct pton { char *p; u_char *n; } *pton, pton_ip6[] = { { "::", IP6_ADDR_UNSPEC }, { "::1", IP6_ADDR_LOOPBACK }, { "fe08::", "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00" }, { "fe08::1", "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01" }, { "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" }, { "cafe::babe:dead:beef:0:ffff", "\xca\xfe\x00\x00\x00\x00" "\xba\xbe\xde\xad\xbe\xef\x00\x00\xff\xff" }, { "::1.2.3.4", "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x01\x02\x03\x04" }, { ":cafe", NULL }, { ":::", NULL }, { "::fffff", NULL }, { NULL } }, pton_eth[] = { { "0:d:e:a:d:0", "\x00\x0d\x0e\x0a\x0d\x00" }, { "ff:ff:ff:ff:ff:ff", ETH_ADDR_BROADCAST }, { "00:d:0e:a:0d:0", "\x00\x0d\x0e\x0a\x0d\x00" }, { ":d:e:a:d:0", NULL }, { "0:d:e:a:d:", NULL }, { "0:d:e:a:def:0", NULL }, { "0:d:e:a:d:0:0", NULL }, { "0:0:0:0:0:0", "\x00\x00\x00\x00\x00\x00" }, { NULL } }; struct addr a, b; int res; ADDR_PACK(&a, htonl(0x010203ff)); a.addr_bits = 17; addr_pton("1.2.3.255/17", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad /17 handling"); a.addr_bits = 32; addr_pton("1.2.3.255", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad handling of missing /32"); fail_unless(addr_pton("1.2.3.4/33", &b) < 0, "accepted /33"); fail_unless(addr_pton("1.2.3.256", &b) < 0, "accepted .256"); fail_unless(addr_pton("1.2.3.4.5", &b) < 0, "accepted quint octet"); fail_unless(addr_pton("1.2.3", &b) < 0, "accepted triple octet"); fail_unless(addr_pton("localhost", &b) == 0, "barfed on localhost"); fail_unless(addr_pton("localhost/24", &b) == 0, "barfed on localhost/24"); addr_pton("1.2.3.4/24", &a); addr_pton("1.2.3.4/255.255.255.0", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad /255.255.255.0 handling"); for (pton = pton_eth; pton->n != NULL; pton++) { res = addr_pton(pton->p, &a); if (pton->n != NULL) { fail_unless(res == 0 && a.addr_type == ADDR_TYPE_ETH && a.addr_bits == ETH_ADDR_BITS && memcmp(&a.addr_eth, pton->n, ETH_ADDR_LEN) == 0, pton->p); } else { fail_unless(res < 0, pton->p); } } for (pton = pton_ip6; pton->n != NULL; pton++) { res = addr_pton(pton->p, &a); if (pton->n != NULL) { fail_unless(res == 0 && a.addr_type == ADDR_TYPE_IP6 && a.addr_bits == IP6_ADDR_BITS && memcmp(&a.addr_ip6, pton->n, IP6_ADDR_LEN) == 0, pton->p); } else { fail_unless(res < 0, pton->p); } } } END_TEST START_TEST(test_addr_ntoa) { struct addr a; int i; ADDR_PACK(&a, htonl(0x01020304)); for (i = 0; i < 1000; i++) { fail_unless(strcmp(addr_ntoa(&a), "1.2.3.4") == 0, "barfed on 1.2.3.4 loop"); } } END_TEST START_TEST(test_addr_ntos) { struct sockaddr_in s1, s2; struct addr a; memset(&s1, 0, sizeof(s1)); memset(&s2, 0, sizeof(s2)); SIN_PACK(&s1, htonl(0x01020304), 0); ADDR_PACK(&a, htonl(0x01020304)); addr_ntos(&a, (SA *)&s2); fail_unless(memcmp(&s1, &s2, sizeof(s1)) == 0, "bad sockaddr_in"); } END_TEST START_TEST(test_addr_ston) { struct sockaddr_in s, t; struct addr a, b; memset(&a, 0, sizeof(a)); ADDR_PACK(&a, htonl(0x01020304)); memcpy(&b, &a, sizeof(&b)); SIN_PACK(&s, htonl(0x01020304), 0); memcpy(&t, &s, sizeof(&t)); addr_ston((SA *)&s, &b); fail_unless(memcmp(&a, &b, sizeof(a)) == 0, "bad addr"); #ifdef HAVE_SOCKADDR_SA_LEN s.sin_len = 0; fail_unless(addr_ston((SA *)&s, &b) == 0 && addr_cmp(&a, &b) == 0, "sin_len == 0"); #endif s.sin_family = 123; fail_unless(addr_ston((SA *)&s, &b) < 0, "sin_family == 123"); } END_TEST START_TEST(test_addr_btos) { struct sockaddr s; struct addr a; ADDR_PACK(&a, htonl(0xffffff00)); a.addr_bits = 24; fail_unless(addr_btos(a.addr_bits, &s) == 0, "b0rked"); } END_TEST START_TEST(test_addr_stob) { struct sockaddr_in s; struct addr a; SIN_PACK(&s, htonl(0xffffff00), 0); addr_stob((SA *)&s, &a.addr_bits); fail_unless(a.addr_bits == 24, "b0rked"); /* XXX - BSD routing sockets or SIOCGIFNETMASK */ s.sin_family = 0; fail_unless(addr_stob((SA *)&s, &a.addr_bits) == 0 && a.addr_bits == 24, "sin_family = 0"); } END_TEST START_TEST(test_addr_btom) { struct addr a; uint32_t mask; ADDR_PACK(&a, htonl(0xffffff00)); a.addr_bits = 24; addr_btom(a.addr_bits, &mask, sizeof(mask)); fail_unless(mask == htonl(0xffffff00), "b0rked"); } END_TEST START_TEST(test_addr_mtob) { struct addr a; uint32_t mask; mask = htonl(0xffffff00); addr_mtob(&mask, sizeof(mask), &a.addr_bits); fail_unless(a.addr_bits == 24, "b0rked"); } END_TEST Suite * addr_suite(void) { Suite *s = suite_create("addr"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_addr_pack); tcase_add_test(tc_core, test_addr_cmp); tcase_add_test(tc_core, test_addr_bcast); tcase_add_test(tc_core, test_addr_net); tcase_add_test(tc_core, test_addr_ntop); tcase_add_test(tc_core, test_addr_pton); tcase_add_test(tc_core, test_addr_ntoa); tcase_add_test(tc_core, test_addr_ntos); tcase_add_test(tc_core, test_addr_ston); tcase_add_test(tc_core, test_addr_btos); tcase_add_test(tc_core, test_addr_stob); tcase_add_test(tc_core, test_addr_btom); tcase_add_test(tc_core, test_addr_mtob); return (s); } int main(void) { Suite *s = addr_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_arp.c0000644000076500007650000000214110363372615020351 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_arp_pack) { } END_TEST START_TEST(test_arp_openclose) { arp_t *a; fail_unless((a = arp_open()) != NULL, "open failed"); fail_unless((a = arp_close(a)) == NULL, "close failed"); } END_TEST START_TEST(test_arp_add) { } END_TEST START_TEST(test_arp_delete) { } END_TEST START_TEST(test_arp_get) { } END_TEST START_TEST(test_arp_loop) { } END_TEST Suite * arp_suite(void) { Suite *s = suite_create("arp"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_arp_pack); tcase_add_test(tc_core, test_arp_openclose); tcase_add_test(tc_core, test_arp_add); tcase_add_test(tc_core, test_arp_delete); tcase_add_test(tc_core, test_arp_get); tcase_add_test(tc_core, test_arp_loop); return (s); } int main(void) { Suite *s = arp_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_blob.c0000644000076500007650000001043510363372615020512 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_blob_newfree) { blob_t *b; fail_unless((b = blob_new()) != NULL, "new failed"); fail_unless((b = blob_free(b)) == NULL, "free failed"); } END_TEST START_TEST(test_blob_readwrite) { blob_t *b; char tmp[32]; b = blob_new(); blob_write(b, "foobar", 7); blob_write(b, "spazzo", 7); blob_write(b, "doofus", 7); blob_rewind(b); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "foobar") == 0, "read1 failed"); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "spazzo") == 0, "read2 failed"); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "doofus") == 0, "read3 failed"); blob_free(b); } END_TEST START_TEST(test_blob_insertdelete) { blob_t *b, bf; char tmp[32]; b = blob_new(); fail_unless(blob_insert(b, "foo", 3) == 3, "insert1 failed"); blob_rewind(b); fail_unless(blob_insert(b, "bar", 3) == 3, "insert2 failed"); blob_rewind(b); blob_read(b, tmp, 6); tmp[6] = 0; fail_unless(strcmp(tmp,"barfoo") == 0, "read failed"); blob_rewind(b); fail_unless(blob_delete(b, NULL, 3) == 3, "delete failed"); blob_rewind(b); blob_read(b, tmp, 3); tmp[3] = 0; fail_unless(strcmp(tmp,"foo") == 0, "read failed"); fail_unless(blob_delete(b, NULL, 4) < 0, "deleted more than size"); b = blob_free(b); bf.base = "foobar"; bf.end = 6; bf.off = bf.size = 0; fail_unless(blob_insert(&bf, "foobar", 6) < 0, "inserted into fixed"); fail_unless(blob_delete(&bf, NULL, 3) < 0, "deleted from fixed"); } END_TEST START_TEST(test_blob_packunpack) { blob_t *b; uint32_t D, d; uint16_t H, h; u_char c; char s[128]; u_char buf[6]; b = blob_new(); D = 0xdeadbeef; H = 0xbabe; memcpy(buf, "f\x00\x00bar", 6); c = 'c'; d = 555; h = 666; strcpy(s, "donkey"); #if 0 printf("D: 0x%x H: 0x%x c: %c d: %d h: %d s: %s\n", D, H, c, d, h, s); #endif fail_unless(blob_pack(b, "whee:%D%H%*b%c%d%h%s\r\n", D, H, sizeof(buf), buf, c, d, h, s) == 0, "pack failed"); blob_rewind(b); #if 0 blob_print(b, "hexl", blob_left(b)); #endif fail_unless(blob_unpack(b, "whee:%D%H%*b%c%d%h%*s\r\n", &D, &H, sizeof(buf), buf, &c, &d, &h, sizeof(s), s) == 0, "unpack failed"); #if 0 printf("D: 0x%x H: 0x%x c: %c d: %d h: %d s: %s\n", D, H, c, d, h, s); #endif if (D != 0xdeadbeef || H != 0xbabe || memcmp(buf, "f\x00\x00bar", 6) != 0 || c != 'c' || d != 555 || h != 666 || strcmp(s, "donkey") != 0) fail("unpacked weird crap"); blob_free(b); } END_TEST START_TEST(test_blob_seek) { blob_t *b; b = blob_new(); blob_insert(b, "foobar", 6); blob_rewind(b); fail_unless(blob_skip(b, 3) == 3, "skip failed"); fail_unless(blob_skip(b, 3) == 6, "skip to end failed"); fail_unless(blob_skip(b, 1) < 0, "skipped past end"); fail_unless(blob_seek(b, -1, SEEK_END) == 5, "end seek failed"); fail_unless(blob_seek(b, 1, SEEK_SET) == 1, "set seek failed"); blob_rewind(b); fail_unless(blob_seek(b, -1, SEEK_CUR) < 0, "seeked past 0"); fail_unless(blob_seek(b, 3, SEEK_CUR) == 3, "cur seek failed"); blob_free(b); } END_TEST START_TEST(test_blob_index) { blob_t *b; b = blob_new(); blob_write(b, "this is only a test!", 20); blob_rewind(b); fail_unless(blob_index(b, "this", 4) == 0, "index start failed"); fail_unless(blob_index(b, "!", 1) == 19, "index end failed"); fail_unless(blob_index(b, "only ", 5) == 8, "index middle failed"); fail_unless(blob_rindex(b, "!", 1) == 19, "rindex end failed"); fail_unless(blob_rindex(b, "this", 4) == 0, "rindex start failed"); fail_unless(blob_rindex(b, "only ", 5) == 8, "rindex middle failed"); blob_free(b); } END_TEST Suite * blob_suite(void) { Suite *s = suite_create("blob"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_blob_newfree); tcase_add_test(tc_core, test_blob_readwrite); tcase_add_test(tc_core, test_blob_insertdelete); tcase_add_test(tc_core, test_blob_packunpack); tcase_add_test(tc_core, test_blob_seek); tcase_add_test(tc_core, test_blob_index); return (s); } int main(void) { Suite *s = blob_suite(); SRunner *sr = srunner_create(s); int nf; #if 0 srunner_set_fork_status(sr, CK_NOFORK); #endif srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_eth.c0000644000076500007650000000161510363372615020354 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_eth_pack) { } END_TEST START_TEST(test_eth_openclose) { } END_TEST START_TEST(test_eth_get) { } END_TEST START_TEST(test_eth_set) { } END_TEST START_TEST(test_eth_send) { } END_TEST Suite * eth_suite(void) { Suite *s = suite_create("eth"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_eth_pack); tcase_add_test(tc_core, test_eth_openclose); tcase_add_test(tc_core, test_eth_get); tcase_add_test(tc_core, test_eth_set); tcase_add_test(tc_core, test_eth_send); return (s); } int main(void) { Suite *s = eth_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_fw.c0000644000076500007650000000205510363372615020207 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_fw_pack) { } END_TEST START_TEST(test_fw_openclose) { fw_t *fw; fail_unless((fw = fw_open()) != NULL, "open failed"); fail_unless((fw = fw_close(fw)) == NULL, "closed failed"); } END_TEST START_TEST(test_fw_add) { } END_TEST START_TEST(test_fw_delete) { } END_TEST START_TEST(test_fw_loop) { } END_TEST START_TEST(test_fw_close) { } END_TEST Suite * fw_suite(void) { Suite *s = suite_create("fw"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_fw_pack); tcase_add_test(tc_core, test_fw_openclose); tcase_add_test(tc_core, test_fw_add); tcase_add_test(tc_core, test_fw_delete); tcase_add_test(tc_core, test_fw_loop); return (s); } int main(void) { Suite *s = fw_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_intf.c0000644000076500007650000000262210363372615020533 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_intf_openclose) { intf_t *i; fail_unless((i = intf_open()) != NULL, "open failed"); fail_unless((i = intf_close(i)) == NULL, "closed failed"); } END_TEST START_TEST(test_intf_get) { struct intf_entry ifent; intf_t *i; i = intf_open(); memset(&ifent, 0, sizeof(ifent)); fail_unless(intf_get(i, &ifent) < 0, "didn't fail on empty request"); ifent.intf_len = sizeof(ifent); fail_unless(intf_get(i, &ifent) < 0, "didn't fail on empty name"); intf_close(i); } END_TEST START_TEST(test_intf_get_src) { } END_TEST START_TEST(test_intf_get_dst) { } END_TEST START_TEST(test_intf_set) { } END_TEST START_TEST(test_intf_loop) { } END_TEST Suite * intf_suite(void) { Suite *s = suite_create("intf"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_intf_openclose); tcase_add_test(tc_core, test_intf_get); tcase_add_test(tc_core, test_intf_get_src); tcase_add_test(tc_core, test_intf_get_dst); tcase_add_test(tc_core, test_intf_set); tcase_add_test(tc_core, test_intf_loop); return (s); } int main(void) { Suite *s = intf_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_ip.c0000644000076500007650000000226010363372615020201 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_ip_fill) { } END_TEST START_TEST(test_ip_openclose) { ip_t *i; fail_unless((i = ip_open()) != NULL, "open failed"); fail_unless((i = ip_close(i)) == NULL, "close failed"); } END_TEST START_TEST(test_ip_send) { } END_TEST START_TEST(test_ip_ntoa) { } END_TEST START_TEST(test_ip_aton) { } END_TEST START_TEST(test_ip_add_option) { } END_TEST START_TEST(test_ip_checksum) { } END_TEST Suite * ip_suite(void) { Suite *s = suite_create("ip"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_ip_fill); tcase_add_test(tc_core, test_ip_openclose); tcase_add_test(tc_core, test_ip_send); tcase_add_test(tc_core, test_ip_ntoa); tcase_add_test(tc_core, test_ip_aton); tcase_add_test(tc_core, test_ip_add_option); tcase_add_test(tc_core, test_ip_checksum); return (s); } int main(void) { Suite *s = ip_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_rand.c0000644000076500007650000000405410363372615020520 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_rand_openclose) { rand_t *r; fail_unless((r = rand_open()) != NULL, "open failed"); fail_unless((r = rand_close(r)) == NULL, "close failed"); } END_TEST START_TEST(test_rand_get) { rand_t *r; uint32_t i; r = rand_open(); fail_unless(rand_get(r, &i, sizeof(i)) == 0, "get failed"); /* XXX - add distribution tests */ r = rand_close(r); } END_TEST START_TEST(test_rand_set) { rand_t *r; u_char buf1[BUFSIZ], buf2[BUFSIZ]; uint32_t i; i = 666; r = rand_open(); memset(buf1, 0, sizeof(buf1)); memset(buf2, 0, sizeof(buf2)); fail_unless(rand_get(r, buf1, sizeof(buf1)) == 0, "get failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) != 0, "get b0rked"); fail_unless(rand_set(r, &i, sizeof(i)) == 0, "set failed"); fail_unless(rand_get(r, buf2, sizeof(buf2)) == 0, "get2 failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) != 0, "set/get b0rked"); fail_unless(rand_set(r, &i, sizeof(i)) == 0, "set2 failed"); fail_unless(rand_get(r, buf1, sizeof(buf1)) == 0, "get3 failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) == 0, "set b0rked"); r = rand_close(r); } END_TEST START_TEST(test_rand_shuffle) { rand_t *r; char buf[BUFSIZ]; #define SHUFFLE_TEXT "hello how are you doing today?" r = rand_open(); strcpy(buf, SHUFFLE_TEXT); rand_shuffle(r, buf, strlen(buf), 1); fail_unless(strcmp(buf, SHUFFLE_TEXT) != 0, "shuffle failed"); r = rand_close(r); } END_TEST Suite * rand_suite(void) { Suite *s = suite_create("rand"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_rand_openclose); tcase_add_test(tc_core, test_rand_get); tcase_add_test(tc_core, test_rand_set); tcase_add_test(tc_core, test_rand_shuffle); return (s); } int main(void) { Suite *s = rand_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/check_route.c0000644000076500007650000000205610363372615020732 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_route_openclose) { route_t *r; fail_unless((r = route_open()) != NULL, "open failed"); fail_unless((r = route_close(r)) == NULL, "close failed"); } END_TEST START_TEST(test_route_add) { } END_TEST START_TEST(test_route_delete) { } END_TEST START_TEST(test_route_get) { } END_TEST START_TEST(test_route_loop) { } END_TEST Suite * route_suite(void) { Suite *s = suite_create("route"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_route_openclose); tcase_add_test(tc_core, test_route_add); tcase_add_test(tc_core, test_route_delete); tcase_add_test(tc_core, test_route_get); tcase_add_test(tc_core, test_route_loop); return (s); } int main(void) { Suite *s = route_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/test/check/Makefile.am0000644000076500007650000000122307640762604020327 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 427 2003-03-28 06:02:44Z dugsong $ include $(top_srcdir)/Makefile.am.common INCLUDES = -I$(top_srcdir)/include @CHECKINC@ if HAVE_CHECK TESTS = check_addr check_arp check_blob check_eth check_fw check_ip \ check_intf check_rand check_route else TESTS = endif noinst_PROGRAMS = $(TESTS) check_addr_SOURCES = check_addr.c check_arp_SOURCES = check_arp.c check_blob_SOURCES = check_blob.c check_eth_SOURCES = check_eth.c check_fw_SOURCES = check_fw.c check_intf_SOURCES = check_intf.c check_ip_SOURCES = check_ip.c check_rand_SOURCES = check_rand.c check_route_SOURCES = check_route.c LDADD = $(top_builddir)/src/libdnet.la @CHECKLIB@ libdnet-1.12/test/check/Makefile.in0000644000076500007650000003411410363627052020336 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include INCLUDES = -I$(top_srcdir)/include @CHECKINC@ @HAVE_CHECK_TRUE@TESTS = check_addr check_arp check_blob check_eth check_fw check_ip \ @HAVE_CHECK_TRUE@ check_intf check_rand check_route @HAVE_CHECK_FALSE@TESTS = noinst_PROGRAMS = $(TESTS) check_addr_SOURCES = check_addr.c check_arp_SOURCES = check_arp.c check_blob_SOURCES = check_blob.c check_eth_SOURCES = check_eth.c check_fw_SOURCES = check_fw.c check_intf_SOURCES = check_intf.c check_ip_SOURCES = check_ip.c check_rand_SOURCES = check_rand.c check_route_SOURCES = check_route.c LDADD = $(top_builddir)/src/libdnet.la @CHECKLIB@ subdir = test/check mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = @HAVE_CHECK_TRUE@noinst_PROGRAMS = check_addr$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_arp$(EXEEXT) check_blob$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_eth$(EXEEXT) check_fw$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_ip$(EXEEXT) check_intf$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_rand$(EXEEXT) check_route$(EXEEXT) @HAVE_CHECK_FALSE@noinst_PROGRAMS = PROGRAMS = $(noinst_PROGRAMS) am_check_addr_OBJECTS = check_addr.$(OBJEXT) check_addr_OBJECTS = $(am_check_addr_OBJECTS) check_addr_LDADD = $(LDADD) check_addr_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_addr_LDFLAGS = am_check_arp_OBJECTS = check_arp.$(OBJEXT) check_arp_OBJECTS = $(am_check_arp_OBJECTS) check_arp_LDADD = $(LDADD) check_arp_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_arp_LDFLAGS = am_check_blob_OBJECTS = check_blob.$(OBJEXT) check_blob_OBJECTS = $(am_check_blob_OBJECTS) check_blob_LDADD = $(LDADD) check_blob_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_blob_LDFLAGS = am_check_eth_OBJECTS = check_eth.$(OBJEXT) check_eth_OBJECTS = $(am_check_eth_OBJECTS) check_eth_LDADD = $(LDADD) check_eth_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_eth_LDFLAGS = am_check_fw_OBJECTS = check_fw.$(OBJEXT) check_fw_OBJECTS = $(am_check_fw_OBJECTS) check_fw_LDADD = $(LDADD) check_fw_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_fw_LDFLAGS = am_check_intf_OBJECTS = check_intf.$(OBJEXT) check_intf_OBJECTS = $(am_check_intf_OBJECTS) check_intf_LDADD = $(LDADD) check_intf_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_intf_LDFLAGS = am_check_ip_OBJECTS = check_ip.$(OBJEXT) check_ip_OBJECTS = $(am_check_ip_OBJECTS) check_ip_LDADD = $(LDADD) check_ip_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_ip_LDFLAGS = am_check_rand_OBJECTS = check_rand.$(OBJEXT) check_rand_OBJECTS = $(am_check_rand_OBJECTS) check_rand_LDADD = $(LDADD) check_rand_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_rand_LDFLAGS = am_check_route_OBJECTS = check_route.$(OBJEXT) check_route_OBJECTS = $(am_check_route_OBJECTS) check_route_LDADD = $(LDADD) check_route_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_route_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(check_addr_SOURCES) $(check_arp_SOURCES) \ $(check_blob_SOURCES) $(check_eth_SOURCES) $(check_fw_SOURCES) \ $(check_intf_SOURCES) $(check_ip_SOURCES) $(check_rand_SOURCES) \ $(check_route_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(check_addr_SOURCES) $(check_arp_SOURCES) $(check_blob_SOURCES) $(check_eth_SOURCES) $(check_fw_SOURCES) $(check_intf_SOURCES) $(check_ip_SOURCES) $(check_rand_SOURCES) $(check_route_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/check/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done check_addr$(EXEEXT): $(check_addr_OBJECTS) $(check_addr_DEPENDENCIES) @rm -f check_addr$(EXEEXT) $(LINK) $(check_addr_LDFLAGS) $(check_addr_OBJECTS) $(check_addr_LDADD) $(LIBS) check_arp$(EXEEXT): $(check_arp_OBJECTS) $(check_arp_DEPENDENCIES) @rm -f check_arp$(EXEEXT) $(LINK) $(check_arp_LDFLAGS) $(check_arp_OBJECTS) $(check_arp_LDADD) $(LIBS) check_blob$(EXEEXT): $(check_blob_OBJECTS) $(check_blob_DEPENDENCIES) @rm -f check_blob$(EXEEXT) $(LINK) $(check_blob_LDFLAGS) $(check_blob_OBJECTS) $(check_blob_LDADD) $(LIBS) check_eth$(EXEEXT): $(check_eth_OBJECTS) $(check_eth_DEPENDENCIES) @rm -f check_eth$(EXEEXT) $(LINK) $(check_eth_LDFLAGS) $(check_eth_OBJECTS) $(check_eth_LDADD) $(LIBS) check_fw$(EXEEXT): $(check_fw_OBJECTS) $(check_fw_DEPENDENCIES) @rm -f check_fw$(EXEEXT) $(LINK) $(check_fw_LDFLAGS) $(check_fw_OBJECTS) $(check_fw_LDADD) $(LIBS) check_intf$(EXEEXT): $(check_intf_OBJECTS) $(check_intf_DEPENDENCIES) @rm -f check_intf$(EXEEXT) $(LINK) $(check_intf_LDFLAGS) $(check_intf_OBJECTS) $(check_intf_LDADD) $(LIBS) check_ip$(EXEEXT): $(check_ip_OBJECTS) $(check_ip_DEPENDENCIES) @rm -f check_ip$(EXEEXT) $(LINK) $(check_ip_LDFLAGS) $(check_ip_OBJECTS) $(check_ip_LDADD) $(LIBS) check_rand$(EXEEXT): $(check_rand_OBJECTS) $(check_rand_DEPENDENCIES) @rm -f check_rand$(EXEEXT) $(LINK) $(check_rand_LDFLAGS) $(check_rand_OBJECTS) $(check_rand_LDADD) $(LIBS) check_route$(EXEEXT): $(check_route_OBJECTS) $(check_route_DEPENDENCIES) @rm -f check_route$(EXEEXT) $(LINK) $(check_route_LDFLAGS) $(check_route_OBJECTS) $(check_route_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: GTAGS all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libdnet-1.12/test/dnet/0000755000076500007650000000000010554406364016146 5ustar dugsongdugsong00000000000000libdnet-1.12/test/dnet/addr.c0000644000076500007650000000141207451002214017206 0ustar dugsongdugsong00000000000000/* * addr.c * * Copyright (c) 2001 Dug Song * * $Id: addr.c 315 2002-03-29 06:07:08Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "mod.h" void addr_usage(void) { fprintf(stderr, "Usage: dnet addr
...\n"); exit(1); } int addr_main(int argc, char *argv[]) { struct addr addr; int c, len; if (argc == 1 || *(argv[1]) == '-') addr_usage(); for (c = 1; c < argc; c++) { if (addr_aton(argv[c], &addr) < 0) addr_usage(); len = addr.addr_bits / 8; if (write(STDOUT_FILENO, addr.addr_data8, len) != len) err(1, "write"); } exit(0); } struct mod mod_addr = { "addr", MOD_TYPE_DATA, addr_main }; libdnet-1.12/test/dnet/arp.c0000644000076500007650000000732507466127704017111 0ustar dugsongdugsong00000000000000/* * arp.c * * Copyright (c) 2001 Dug Song * * $Id: arp.c 352 2002-05-08 04:55:32Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void arp_usage(void) { fprintf(stderr, "Usage: dnet arp [op|sha|spa|tha|tpa ] ...\n" " dnet arp show\n" " dnet arp get \n" " dnet arp add \n" " dnet arp delete \n"); exit(1); } static int print_arp(const struct arp_entry *entry, void *arg) { printf("%s at %s\n", addr_ntoa(&entry->arp_pa), addr_ntoa(&entry->arp_ha)); return (0); } static int arp_kern_main(int argc, char *argv[]) { struct arp_entry entry; arp_t *arp; char *cmd; if (argc < 2) arp_usage(); cmd = argv[1]; if ((arp = arp_open()) == NULL) err(1, "arp_open"); if (strcmp(cmd, "show") == 0) { if (arp_loop(arp, print_arp, NULL) < 0) err(1, "arp_loop"); } else if (strcmp(cmd, "get") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0) err(1, "addr_pton"); if (arp_get(arp, &entry) < 0) err(1, "arp_get"); print_arp(&entry, NULL); } else if (strcmp(cmd, "add") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0 || addr_pton(argv[3], &entry.arp_ha) < 0) err(1, "addr_pton"); if (arp_add(arp, &entry) < 0) err(1, "arp_add"); printf("%s added\n", addr_ntoa(&entry.arp_pa)); } else if (strcmp(cmd, "delete") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0) err(1, "addr_pton"); if (arp_delete(arp, &entry) < 0) err(1, "arp_delete"); printf("%s deleted\n", addr_ntoa(&entry.arp_pa)); } else arp_usage(); arp_close(arp); return (0); } int arp_main(int argc, char *argv[]) { struct arp_hdr *arp; struct arp_ethip *ethip; struct addr addr; u_char *p, buf[ETH_MTU]; /* XXX */ char *name, *value; int c, len; if (argc == 1 || *(argv[1]) == '-') arp_usage(); /* XXX - total trash */ if (argc > 1 && (strcmp(argv[1], "show") == 0 || strcmp(argv[1], "get") == 0 || strcmp(argv[1], "add") == 0 || strcmp(argv[1], "delete") == 0)) return (arp_kern_main(argc, argv)); srand(time(NULL)); arp = (struct arp_hdr *)buf; arp->ar_hrd = htons(ARP_HRD_ETH); arp->ar_pro = htons(ARP_PRO_IP); arp->ar_hln = ETH_ADDR_LEN; arp->ar_pln = IP_ADDR_LEN; arp->ar_op = ARP_OP_REQUEST; ethip = (struct arp_ethip *)(buf + ARP_HDR_LEN); memset(ethip, 0, sizeof(*ethip)); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "op") == 0) { if (op_aton(value, &arp->ar_op) < 0) arp_usage(); } else if (strcmp(name, "sha") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_sha, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "spa") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_spa, &addr.addr_ip, IP_ADDR_LEN); } else if (strcmp(name, "tha") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_tha, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "tpa") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_tpa, &addr.addr_ip, IP_ADDR_LEN); } else arp_usage(); } argc -= c; argv += c; if (argc != 0) arp_usage(); p = buf + ARP_HDR_LEN + ARP_ETHIP_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_arp = { "arp", MOD_TYPE_ENCAP|MOD_TYPE_KERN, arp_main }; libdnet-1.12/test/dnet/aton.c0000644000076500007650000000760307552562722017266 0ustar dugsongdugsong00000000000000/* * aton.c * * Copyright (c) 2001 Dug Song * * $Id: aton.c 366 2002-10-14 15:42:10Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" int type_aton(char *string, uint16_t *type) { u_int i; if (strcmp(string, "ip") == 0) *type = htons(ETH_TYPE_IP); else if (strcmp(string, "arp") == 0) *type = htons(ETH_TYPE_ARP); else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *type = htons(i & 0xffff); } return (0); } int op_aton(char *string, uint16_t *op) { u_int i; if (strncasecmp(string, "req", 3) == 0) *op = htons(ARP_OP_REQUEST); else if (strncasecmp(string, "rep", 3) == 0) *op = htons(ARP_OP_REPLY); else if (strncasecmp(string, "revreq", 6) == 0) *op = htons(ARP_OP_REVREQUEST); else if (strncasecmp(string, "revrep", 6) == 0) *op = htons(ARP_OP_REVREPLY); else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *op = htons(i & 0xffff); } return (0); } int proto_aton(char *string, uint8_t *proto) { struct protoent *pp; u_int i; if ((pp = getprotobyname(string)) != NULL) *proto = pp->p_proto; else { if (sscanf(string, "%i", &i) != 1 || i > 0xff) return (-1); *proto = i & 0xff; } return (0); } int off_aton(char *string, uint16_t *off) { int i; char *p; if (strncmp(string, "0x", 2) == 0) { if (sscanf(string, "%i", &i) != 1 || i > IP_OFFMASK) return (-1); *off = htons(i); } else { i = strtol(string, &p, 10); if (*string == '\0' || (*p != '\0' && *p != '+') || i > IP_OFFMASK) return (-1); *off = htons(((*p == '+') ? IP_MF : 0) | (i >> 3)); } return (0); } int port_aton(char *string, uint16_t *port) { struct servent *sp; u_int i; /* XXX */ if ((sp = getservbyname(string, "tcp")) != NULL) { *port = sp->s_port; } else if ((sp = getservbyname(string, "udp")) != NULL) { *port = sp->s_port; } else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *port = htons(i & 0xffff); } return (0); } int seq_aton(char *string, uint32_t *seq) { char *p; *seq = strtoul(string, &p, 10); if (*string == '\0' || *p != '\0') return (-1); *seq = htonl(*seq); return (0); } int flags_aton(char *string, uint8_t *flags) { char *p; u_int i; *flags = 0; if (strncmp(string, "0x", 2) == 0) { if (sscanf(string, "%i", &i) != 1 || i > 0xff) return (-1); *flags = i & 0xff; return (0); } for (p = string; *p != '\0'; p++) { switch (*p) { case 'S': *flags |= TH_SYN; break; case 'A': *flags |= TH_ACK; break; case 'F': *flags |= TH_FIN; break; case 'R': *flags |= TH_RST; break; case 'P': *flags |= TH_PUSH; break; case 'U': *flags |= TH_URG; break; default: return (-1); } } return (0); } static u_char hex2num(char ch, char cl) { ch = tolower(ch), cl = tolower(cl); if (ch >= '0' && ch <= '9') ch -= '0'; else if (ch >= 'a' && ch <= 'f') ch -= 'a' - 10; else return (0); if (cl >= '0' && cl <= '9') cl -= '0'; else if (cl >= 'a' && cl <= 'f') cl -= 'a' - 10; else return (0); return ((u_char)((ch << 4) | cl)); } int fmt_aton(char *string, u_char *buf) { u_char *u; char *p; for (u = buf, p = string; *p != '\0'; p++) { if (*p != '\\') { *u++ = *p; continue; } if (*++p == '\0') break; if (*p == '\\') *u++ = '\\'; else if (*p == '\'') *u++ = '\''; else if (*p == '"') *u++ = '"'; else if (*p == 'a') *u++ = '\a'; else if (*p == 'b') *u++ = '\b'; else if (*p == 'e') *u++ = 033; else if (*p == 'f') *u++ = '\f'; else if (*p == 'n') *u++ = '\n'; else if (*p == 'r') *u++ = '\r'; else if (*p == 't') *u++ = '\t'; else if (*p == 'v') *u++ = '\v'; else if (*p == 'x' && p[1] != '\0' && p[2] != '\0') { *u++ = hex2num(p[1], p[2]); p += 2; } else return (-1); } return (u - buf); } libdnet-1.12/test/dnet/aton.h0000644000076500007650000000102007430676702017255 0ustar dugsongdugsong00000000000000/* * aton.h * * Copyright (c) 2002 Dug Song * * $Id: aton.h 274 2002-02-08 07:26:58Z dugsong $ */ #ifndef ATON_H #define ATON_H int type_aton(char *string, uint16_t *type); int op_aton(char *string, uint16_t *op); int proto_aton(char *string, uint8_t *proto); int off_aton(char *string, uint16_t *off); int port_aton(char *string, uint16_t *port); int seq_aton(char *string, uint32_t *seq); int flags_aton(char *string, uint8_t *flags); int fmt_aton(char *string, u_char *buf); #endif /* ATON_H */ libdnet-1.12/test/dnet/dnet.80000644000076500007650000001437607452004046017176 0ustar dugsongdugsong00000000000000.\" $Id: dnet.8 328 2002-04-01 07:11:34Z dugsong $ .\" .\" Copyright (c) 2001 Dug Song .\" .Dd October 17, 2001 .Dt DNET 8 .Os .Sh NAME .Nm dnet .Nd dumb networking library test program .Sh SYNOPSIS .Nm dnet Ar command Ar args Op ... .Sh DESCRIPTION .Nm is a simple test program for the .Xr dnet 3 library. It can be used to compose and transmit network datagrams as a Unix-style filter (e.g. reading from or writing to files and pipes) or modify the local system network configuration (including the ARP cache, firewall ruleset, network interfaces, and routing table). .Pp .Ss Payload generation commands .Bl -tag -width "foo" .It Nm addr Ar address Op ... Convert the .Ar address (specified as a hostname, IP address, or MAC address) into its binary representation on standard output. .It Nm hex Ar string Op ... Convert the C-style escaped .Ar string (shellcode, for instance) into its binary representation on standard output. .It Nm rand Ar len Write .Ar len random bytes to standard output. .El .Ss Packet encapsulation commands .Bl -tag -width "foo" .It Xo .Nm eth .Op Nm type Ar type .Op Nm src Ar mac .Op Nm dst Ar mac .Xc Prepend the data read from standard input with an Ethernet header on standard output. The Ethernet .Ar type may be specified as .Ql arp , .Ql ip , or as a hex, octal, or decimal number. .It Xo .Nm arp .Op Nm op Ar op .Op Nm sha Ar mac .Op Nm spa Ar host .Op Nm tha Ar mac .Op Nm tpa Ar host .Xc Prepend the data read from standard input with an ARP header on standard output. The ARP .Ar op may be specified as .Ql req , .Ql rep , .Ql revreq , .Ql revrep , or as a hex, octal, or decimal number. .It Xo .Nm ip .Op Nm tos Ar num .Op Nm id Ar num .Op Nm off Ar offset .Op Nm ttl Ar num .Op Nm proto Ar protocol .Op Nm src Ar host .Bk -words .Op Nm dst Ar dst .Ek .Xc Prepend the data read from standard input with an IP header on standard output. The fragmentation .Ar offset may be specified as a decimal number (optionally concatenated with .Ql + to indicate more fragments) or as a hex number. The .Ar protocol may be specified by name, or as a hex, octal, or decimal number. .It Xo .Nm icmp .Op Nm type Ar num .Op Nm code Ar num .Xc Prepend the data read from standard input with an ICMP header on standard output. .It Xo .Nm tcp .Op Nm sport Ar port .Op Nm dport Ar port .Op Nm flags Ar flags .Op Nm seq Ar num .Op Nm ack Ar num .Op Nm win Ar num .Op Nm urp Ar num .Xc Prepend the data read from standard input with a TCP header on standard output. A .Ar port may be specified by name or hex, octal, or decimal number. The TCP .Ar flags may be specified as some combination of the characters in the set .Ql SAFRPU or as a hex number. .It Xo .Nm udp .Op Nm sport Ar port .Op Nm dport Ar port .Xc Prepend the data read from standard input with a UDP header on standard output. A .Ar port may be specified by name or hex, octal, or decimal number. .El .Ss Packet transmission commands .Bl -tag -width "foo" .It Nm send Op Ar device Read a packet from standard input and send it over the network. If no .Ar device is specified, the packet is assumed to be an IP datagram and routed to its destination. Otherwise, the packet is assumed to be an Ethernet frame and is transmitted on the specified interface. .El .Ss Kernel interface commands .Bl -tag -width "foo" .It Nm arp show Display the kernel ARP cache. .It Nm arp get Ar host Display the kernel ARP entry for .Ar host . .It Nm arp add Ar host Ar mac Add an ARP entry mapping the .Ar mac address for .Ar host . .It Nm arp delete Ar host Delete the ARP entry for .Ar host . .Pp .It Nm fw show Display the kernel firewall ruleset. .It Xo .Nm fw add Ns \&| Ns Nm delete .Ar action Ar direction Ar device .Ar protocol .Ar src Ns Op \&: Ns Ar port[-max] .Ar dst Ns Op \&: Ns Ar port[-max] .Op Ar type Ns Op /code .Xc Add a rule to or delete a rule from the active firewall ruleset. The .Ar action must be either .Ql allow or .Ql block . The direction must be either .Ql in or .Ql out . The .Ar device may specify an interface name, or .Ql any . The .Ar protocol may be specified by name, or as a decimal number. For TCP and UDP protocols, a .Ar port (or range, if specified with a .Ar max value) may be specified in decimal and appended to the source and/or destination address. For ICMP, a .Ar type (and optional .Ar code ) may be specified in decimal. .It Nm intf show Display the configuration of all network interfaces. .It Nm intf get Ar device Display the configuration for the interface specified by .Ar device . .It Xo .Nm intf set .Ar device .Op Nm alias Ar host .Op Nm dst Ar host .Op Nm inet Ar host .Op Nm link Ar mac .Op Nm up Ns \&| Ns Nm down .Op Nm arp Ns \&| Ns Nm noarp .Xc Configure the interface specified by .Ar device . .It Nm route show Display the kernel routing table. .It Nm route get Ar dst Display the route for the destination .Ar dst , specified as a hostname, IP address, or network prefix in CIDR notation. .It Nm route add Ar dst Ar gw Add a route for the destination .Ar dst through the gateway .Ar gw . .It Nm route delete Ar dst Delete the route for the destination .Ar dst . .El .Sh EXAMPLES Send a UDP datagram containing random shellcode: .Bd -literal -offset indent dnet hex "\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89" \\ "\\x46\\x0c\\xb0\\x0b\\x89\\xf3\\x8d\\x4e\\x08\\x8d\\x56\\x0c\\xcd\\x80" \\ "\\x31\\xdb\\x89\\xd8\\x40\\xcd\\x80\\xe8\\xdc\\xff\\xff\\xff/bin/sh" | \\ dnet udp sport 555 dport 666 | \\ dnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dnet send .Ed .Pp Save an ARP request in a file and send it twice: .Bd -literal -offset indent dnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \\ dnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff > arp.pkt dnet send fxp0 < arp.pkt dnet send fxp0 < arp.pkt .Ed .Pp Send a fragmented ping packet: .Bd -literal -offset indent # Create ping packet with IP header, to set ICMP checksum echo "monkey monkey monkey monkey" | dnet icmp type 8 code 0 | \\ dnet ip proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt # Chop off IP header dd if=ping.pkt of=ping.data bs=20 skip=1 # Fragment IP payload split -b 24 ping.data p. # Send fragments dnet ip id 1 off 0+ proto icmp src 1.2.3.4 dst 5.6.7.8 < p.aa | \\ dnet send dnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \\ dnet send .Ed .Sh SEE ALSO .Xr dnet 3 .Sh AUTHORS Dug Song .Aq dugsong@monkey.org libdnet-1.12/test/dnet/dnet.c0000644000076500007650000000355407451002265017245 0ustar dugsongdugsong00000000000000/* * dnet.c * * Copyright (c) 2001 Dug Song * * $Id: dnet.c 317 2002-03-29 06:07:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "mod.h" /* * XXX - new modules should be registered here */ extern struct mod mod_addr; extern struct mod mod_hex; extern struct mod mod_rand; extern struct mod mod_eth; extern struct mod mod_arp; extern struct mod mod_ip; extern struct mod mod_icmp; extern struct mod mod_tcp; extern struct mod mod_udp; extern struct mod mod_send; extern struct mod mod_fw; extern struct mod mod_intf; extern struct mod mod_route; static struct mod *modules[] = { &mod_addr, &mod_hex, &mod_rand, &mod_eth, &mod_arp, &mod_ip, &mod_icmp, &mod_tcp, &mod_udp, &mod_send, &mod_fw, &mod_intf, &mod_route, NULL }; static void print_modules(int type, char *string) { struct mod **m; int i; fprintf(stderr, "%s commands:\n", string); for (i = 1, m = modules; *m != NULL; m++) { if ((m[0]->type & type) != 0) { fprintf(stderr, "%-10s", m[0]->name); if ((i++ % 8) == 0) fprintf(stderr, "\n"); } } fprintf(stderr, "\n\n"); } static void print_usage(void) { fprintf(stderr, "Usage: dnet ...\n\n"); print_modules(MOD_TYPE_DATA, "Payload generation"); print_modules(MOD_TYPE_ENCAP, "Packet encapsulation"); print_modules(MOD_TYPE_XMIT, "Packet transmission"); print_modules(MOD_TYPE_KERN, "Kernel interface"); } static int do_command(int argc, char *argv[]) { struct mod **m; for (m = modules; *m != NULL; m++) { if (strcmp(argv[0], m[0]->name) == 0) return (m[0]->main(argc, argv)); } return (-1); } int main(int argc, char *argv[]) { if (argc < 2) { print_usage(); exit(1); } if (do_command(argc - 1, argv + 1) < 0) { print_usage(); exit(1); } exit(0); } libdnet-1.12/test/dnet/eth.c0000644000076500007650000000311207430700671017064 0ustar dugsongdugsong00000000000000/* * eth.c * * Copyright (c) 2001 Dug Song * * $Id: eth.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void eth_usage(void) { fprintf(stderr, "Usage: dnet eth [type|src|dst ] ... \n"); exit(1); } int eth_main(int argc, char *argv[]) { struct eth_hdr *eth; struct addr addr; u_char *p, buf[ETH_LEN_MAX]; /* XXX */ char *name, *value; int c, len; eth = (struct eth_hdr *)buf; memset(eth, 0, sizeof(*eth)); eth->eth_type = htons(ETH_TYPE_IP); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "type") == 0) { if (type_aton(value, ð->eth_type) < 0) eth_usage(); } else if (strcmp(name, "src") == 0) { if (addr_aton(value, &addr) < 0) eth_usage(); memcpy(ð->eth_src, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "dst") == 0) { if (addr_aton(value, &addr) < 0) eth_usage(); memcpy(ð->eth_dst, &addr.addr_eth, ETH_ADDR_LEN); } else eth_usage(); } argc -= c; argv += c; if (argc != 0) eth_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read Ethernet payload from tty"); p = buf + ETH_HDR_LEN; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_eth = { "eth", MOD_TYPE_ENCAP, eth_main }; libdnet-1.12/test/dnet/fw.c0000644000076500007650000001075610204206720016721 0ustar dugsongdugsong00000000000000/* * fw.c * * Copyright (c) 2001 Dug Song * * $Id: fw.c 577 2005-02-14 20:45:04Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static void usage(void) { fprintf(stderr, "Usage: dnet fw show\n" " dnet fw add|delete allow|block in|out " "|any [:[-]] " "[:[-]] [[/]]\n"); exit(1); } static int print_rule(const struct fw_rule *fr, void *arg) { struct protoent *pr; char proto[16], sport[16], dport[16], typecode[16]; if (fr->fw_proto == 0) proto[0] = '\0'; else if ((pr = getprotobynumber(fr->fw_proto)) == NULL) snprintf(proto, sizeof(proto), "%d ", fr->fw_proto); else snprintf(proto, sizeof(proto), "%s ", pr->p_name); sport[0] = dport[0] = typecode[0] = '\0'; switch (fr->fw_proto) { case IP_PROTO_ICMP: if (fr->fw_sport[1] && fr->fw_dport[1]) snprintf(typecode, sizeof(typecode), " %d/%d", fr->fw_sport[0], fr->fw_dport[0]); else if (fr->fw_sport[1]) snprintf(typecode, sizeof(typecode), " %d", fr->fw_sport[0]); break; case IP_PROTO_TCP: case IP_PROTO_UDP: if (fr->fw_sport[0] == fr->fw_sport[1]) { snprintf(sport, sizeof(sport), ":%d", fr->fw_sport[0]); } else snprintf(sport, sizeof(sport), ":%d-%d", fr->fw_sport[0], fr->fw_sport[1]); if (fr->fw_dport[0] == fr->fw_dport[1]) { snprintf(dport, sizeof(dport), ":%d", fr->fw_dport[0]); } else snprintf(dport, sizeof(dport), ":%d-%d", fr->fw_dport[0], fr->fw_dport[1]); break; } printf("%s %s %s %s%s%s %s%s%s\n", fr->fw_op == FW_OP_ALLOW ? "allow" : "block", fr->fw_dir == FW_DIR_IN ? "in" : "out", *fr->fw_device ? fr->fw_device : "any", proto, fr->fw_src.addr_type ? addr_ntoa(&fr->fw_src) : "", sport, fr->fw_dst.addr_type ? addr_ntoa(&fr->fw_dst) : "", dport, typecode); return (0); } static int arg_to_fr(int argc, char *argv[], struct fw_rule *fr) { struct protoent *pr; char *p; if (argc < 6) { errno = EINVAL; return (-1); } memset(fr, 0, sizeof(*fr)); fr->fw_op = strcmp(argv[0], "allow") ? FW_OP_BLOCK : FW_OP_ALLOW; fr->fw_dir = strcmp(argv[1], "in") ? FW_DIR_OUT : FW_DIR_IN; if (strcmp(argv[2], "any") != 0) strlcpy(fr->fw_device, argv[2], sizeof(fr->fw_device)); if ((pr = getprotobyname(argv[3])) != NULL) fr->fw_proto = pr->p_proto; else fr->fw_proto = atoi(argv[3]); p = strtok(argv[4], ":"); if (addr_aton(p, &fr->fw_src) < 0) return (-1); if ((p = strtok(NULL, ":")) != NULL) { fr->fw_sport[0] = (uint16_t)strtol(p, &p, 10); if (*p == '-') fr->fw_sport[1] = (uint16_t)strtol(p + 1, NULL, 10); else fr->fw_sport[1] = fr->fw_sport[0]; } else if (fr->fw_proto == IP_PROTO_TCP || fr->fw_proto == IP_PROTO_UDP) { fr->fw_sport[0] = 0; fr->fw_sport[1] = TCP_PORT_MAX; } p = strtok(argv[5], ":"); if (addr_aton(p, &fr->fw_dst) < 0) return (-1); if ((p = strtok(NULL, ":")) != NULL) { fr->fw_dport[0] = (uint16_t)strtol(p, &p, 10); if (*p == '-') fr->fw_dport[1] = (uint16_t)strtol(p + 1, NULL, 10); else fr->fw_dport[1] = fr->fw_dport[0]; } else if (fr->fw_proto == IP_PROTO_TCP || fr->fw_proto == IP_PROTO_UDP) { fr->fw_dport[0] = 0; fr->fw_dport[1] = TCP_PORT_MAX; } if (argc > 6) { if (fr->fw_proto != IP_PROTO_ICMP && fr->fw_proto != IP_PROTO_IGMP) { errno = EINVAL; return (-1); } fr->fw_sport[0] = (uint16_t)strtol(argv[6], &p, 10); fr->fw_sport[1] = 0xff; if (*p == '/') { fr->fw_dport[0] = (uint16_t)strtol(p + 1, NULL, 10); fr->fw_dport[1] = 0xff; } } return (0); } int fw_main(int argc, char *argv[]) { struct fw_rule fr; fw_t *fw; if (argc < 2 || *(argv[1]) == '-') usage(); if ((fw = fw_open()) == NULL) err(1, "fw_open"); if (argc == 2 && strcmp(argv[1], "show") == 0) { if (fw_loop(fw, print_rule, NULL) < 0) err(1, "fw_loop"); } else if (argc > 2 && strcmp(argv[1], "add") == 0) { if (arg_to_fr(argc - 2, argv + 2, &fr) < 0) err(1, "arg_to_fr"); printf("+ "); print_rule(&fr, NULL); if (fw_add(fw, &fr) < 0) err(1, "fw_add"); } else if (argc > 2 && strcmp(argv[1], "delete") == 0) { if (arg_to_fr(argc - 2, argv + 2, &fr) < 0) err(1, "arg_to_fr"); printf("- "); print_rule(&fr, NULL); if (fw_delete(fw, &fr) < 0) err(1, "fw_delete"); } else usage(); fw_close(fw); exit(0); } struct mod mod_fw = { "fw", MOD_TYPE_KERN, fw_main }; libdnet-1.12/test/dnet/hex.c0000644000076500007650000000200510031606612017057 0ustar dugsongdugsong00000000000000/* * hex.c * * Copyright (c) 2001 Dug Song * * $Id: hex.c 488 2004-03-28 17:38:18Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void hex_usage(void) { fprintf(stderr, "Usage: dnet hex ...\n"); exit(1); } int hex_main(int argc, char *argv[]) { char buf[IP_LEN_MAX], *p = buf; int c, len; if (argc == 1 || *(argv[1]) == '-') hex_usage(); for (c = 1; c < argc; c++) { if ((len = fmt_aton(argv[c], (u_char *)argv[c])) < 0) hex_usage(); if (write(STDOUT_FILENO, argv[c], len) != len) err(1, "write"); } if (!isatty(STDIN_FILENO)) { len = sizeof(buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); } return (0); } struct mod mod_hex = { "hex", MOD_TYPE_DATA, hex_main }; libdnet-1.12/test/dnet/icmp.c0000644000076500007650000000245507430700671017245 0ustar dugsongdugsong00000000000000/* * icmp.c * * Copyright (c) 2001 Dug Song * * $Id: icmp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void icmp_usage(void) { fprintf(stderr, "Usage: dnet icmp [type|code ] ...\n"); exit(1); } int icmp_main(int argc, char *argv[]) { struct icmp_hdr *icmp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; icmp = (struct icmp_hdr *)buf; memset(icmp, 0, sizeof(*icmp)); icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "type") == 0) { icmp->icmp_type = atoi(value); } else if (strcmp(name, "code") == 0) { icmp->icmp_code = atoi(value); } else icmp_usage(); } argc -= c; argv += c; if (argc != 0) icmp_usage(); p = buf + ICMP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_icmp = { "icmp", MOD_TYPE_ENCAP, icmp_main }; libdnet-1.12/test/dnet/intf.c0000644000076500007650000001027410000712614017236 0ustar dugsongdugsong00000000000000/* * intf.c * * Copyright (c) 2001 Dug Song * * $Id: intf.c 473 2004-01-13 06:51:56Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static intf_t *intf; static void usage(void) { fprintf(stderr, "Usage: dnet intf show\n" " dnet intf get \n" " dnet intf set " "[alias|dst|inet|link ...] [up|down|arp|noarp ...]\n" " dnet intf src \n" " dnet intf dst \n" ); exit(1); } static char * flags2string(u_short flags) { static char buf[256]; buf[0] = '\0'; if (flags & INTF_FLAG_UP) strlcat(buf, ",UP", sizeof(buf)); if (flags & INTF_FLAG_LOOPBACK) strlcat(buf, ",LOOPBACK", sizeof(buf)); if (flags & INTF_FLAG_POINTOPOINT) strlcat(buf, ",POINTOPOINT", sizeof(buf)); if (flags & INTF_FLAG_NOARP) strlcat(buf, ",NOARP", sizeof(buf)); if (flags & INTF_FLAG_BROADCAST) strlcat(buf, ",BROADCAST", sizeof(buf)); if (flags & INTF_FLAG_MULTICAST) strlcat(buf, ",MULTICAST", sizeof(buf)); if (buf[0] != '\0') return (buf + 1); return (buf); } static int print_intf(const struct intf_entry *entry, void *arg) { int i; printf("%s:", entry->intf_name); printf(" flags=0x%x<%s>", entry->intf_flags, flags2string(entry->intf_flags)); if (entry->intf_mtu != 0) printf(" mtu %d", entry->intf_mtu); printf("\n"); if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { printf("\tinet %s --> %s\n", addr_ntoa(&entry->intf_addr), addr_ntoa(&entry->intf_dst_addr)); } else printf("\tinet %s\n", addr_ntoa(&entry->intf_addr)); } if (entry->intf_link_addr.addr_type == ADDR_TYPE_ETH) printf("\tlink %s\n", addr_ntoa(&entry->intf_link_addr)); for (i = 0; i < entry->intf_alias_num; i++) printf("\talias %s\n", addr_ntoa(&entry->intf_alias_addrs[i])); return (0); } int intf_main(int argc, char *argv[]) { struct intf_entry *entry; struct addr *ap, addr; char *cmd, buf[1024]; if (argc < 2) usage(); cmd = argv[1]; entry = (struct intf_entry *)buf; memset(entry, 0, sizeof(*entry)); entry->intf_len = sizeof(buf); if ((intf = intf_open()) == NULL) err(1, "intf_open"); if (strcmp(cmd, "show") == 0) { if (intf_loop(intf, print_intf, NULL) < 0) err(1, "intf_loop"); } else if (strcmp(cmd, "get") == 0) { if (argc < 3) usage(); strlcpy(entry->intf_name, argv[2], sizeof(entry->intf_name)); if (intf_get(intf, entry) < 0) err(1, "intf_get"); print_intf(entry, NULL); } else if (strcmp(cmd, "src") == 0) { if (argc < 3 || addr_aton(argv[2], &addr) < 0) usage(); if (intf_get_src(intf, entry, &addr) < 0) err(1, "intf_get_src"); print_intf(entry, NULL); } else if (strcmp(cmd, "dst") == 0) { if (argc < 3 || addr_aton(argv[2], &addr) < 0) usage(); if (intf_get_dst(intf, entry, &addr) < 0) err(1, "intf_get_dst"); print_intf(entry, NULL); } else if (strcmp(cmd, "set") == 0) { if (argc < 4) usage(); strlcpy(entry->intf_name, argv[2], sizeof(entry->intf_name)); for (argv += 3, argc -= 3; argc > 1; argv += 2, argc -= 2) { if (strcmp(argv[0], "alias") == 0) { ap = &entry->intf_alias_addrs [entry->intf_alias_num++]; } else if (strcmp(argv[0], "dst") == 0) { ap = &entry->intf_dst_addr; } else if (strcmp(argv[0], "inet") == 0) { ap = &entry->intf_addr; } else if (strcmp(argv[0], "link") == 0) { ap = &entry->intf_link_addr; } else break; if (addr_pton(argv[1], ap) < 0) err(1, "invalid address: %s", argv[1]); } for ( ; argc > 0; argv++, argc--) { if (strcmp(argv[0], "up") == 0) entry->intf_flags |= INTF_FLAG_UP; else if (strcmp(argv[0], "down") == 0) entry->intf_flags &= ~INTF_FLAG_UP; else if (strcmp(argv[0], "arp") == 0) entry->intf_flags &= ~INTF_FLAG_NOARP; else if (strcmp(argv[0], "noarp") == 0) entry->intf_flags |= INTF_FLAG_NOARP; else usage(); } if (intf_set(intf, entry) < 0) err(1, "intf_set"); } else usage(); intf_close(intf); exit(0); } struct mod mod_intf = { "intf", MOD_TYPE_KERN, intf_main }; libdnet-1.12/test/dnet/ip.c0000644000076500007650000000405407430700671016722 0ustar dugsongdugsong00000000000000/* * ip.c * * Copyright (c) 2001 Dug Song * * $Id: ip.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void ip_usage(void) { fprintf(stderr, "Usage: dnet ip [tos|id|off|ttl|proto|src|dst " "] ... \n"); exit(1); } int ip_main(int argc, char *argv[]) { struct ip_hdr *ip; struct addr addr; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); ip = (struct ip_hdr *)buf; ip->ip_hl = 5; ip->ip_v = 4; ip->ip_tos = 0; ip->ip_id = rand() & 0xffff; ip->ip_off = 0; ip->ip_ttl = IP_TTL_MAX; ip->ip_p = rand() & 0xff; ip->ip_sum = 0; ip->ip_src = rand(); ip->ip_dst = rand(); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "tos") == 0) ip->ip_tos = atoi(value); else if (strcmp(name, "id") == 0) ip->ip_id = ntohs(atoi(value)); else if (strcmp(name, "off") == 0) { if (off_aton(value, &ip->ip_off) < 0) ip_usage(); } else if (strcmp(name, "ttl") == 0) ip->ip_ttl = atoi(value); else if (strcmp(name, "proto") == 0) { if (proto_aton(value, &ip->ip_p) < 0) ip_usage(); } else if (strcmp(name, "src") == 0) { if (addr_aton(value, &addr) < 0) ip_usage(); ip->ip_src = addr.addr_ip; } else if (strcmp(name, "dst") == 0) { if (addr_aton(value, &addr) < 0) ip_usage(); ip->ip_dst = addr.addr_ip; } else ip_usage(); } argc -= c; argv += c; if (argc != 0) ip_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read IP payload from tty"); p = buf + IP_HDR_LEN; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; ip->ip_len = htons(len); ip_checksum(buf, len); if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_ip = { "ip", MOD_TYPE_ENCAP, ip_main }; libdnet-1.12/test/dnet/Makefile.am0000644000076500007650000000063007640762604020205 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 427 2003-03-28 06:02:44Z dugsong $ include $(top_srcdir)/Makefile.am.common sbin_PROGRAMS = dnet dnet_SOURCES = addr.c arp.c aton.c aton.h dnet.c eth.c fw.c hex.c \ icmp.c intf.c ip.c mod.h rand.c route.c send.c tcp.c udp.c man_MANS = dnet.8 EXTRA_DIST = $(man_MANS) dnet_LDADD = $(top_builddir)/src/libdnet.la dnet.8.txt: dnet.8 groff -t -e -mdoc -Tascii dnet.8 | col -bx > $@ libdnet-1.12/test/dnet/Makefile.in0000644000076500007650000002650410363627052020217 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include sbin_PROGRAMS = dnet dnet_SOURCES = addr.c arp.c aton.c aton.h dnet.c eth.c fw.c hex.c \ icmp.c intf.c ip.c mod.h rand.c route.c send.c tcp.c udp.c man_MANS = dnet.8 EXTRA_DIST = $(man_MANS) dnet_LDADD = $(top_builddir)/src/libdnet.la subdir = test/dnet mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = sbin_PROGRAMS = dnet$(EXEEXT) PROGRAMS = $(sbin_PROGRAMS) am_dnet_OBJECTS = addr.$(OBJEXT) arp.$(OBJEXT) aton.$(OBJEXT) \ dnet.$(OBJEXT) eth.$(OBJEXT) fw.$(OBJEXT) hex.$(OBJEXT) \ icmp.$(OBJEXT) intf.$(OBJEXT) ip.$(OBJEXT) rand.$(OBJEXT) \ route.$(OBJEXT) send.$(OBJEXT) tcp.$(OBJEXT) udp.$(OBJEXT) dnet_OBJECTS = $(am_dnet_OBJECTS) dnet_DEPENDENCIES = $(top_builddir)/src/libdnet.la dnet_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(dnet_SOURCES) NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(dnet_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/dnet/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dnet$(EXEEXT): $(dnet_OBJECTS) $(dnet_DEPENDENCIES) @rm -f dnet$(EXEEXT) $(LINK) $(dnet_LDFLAGS) $(dnet_OBJECTS) $(dnet_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: man8dir = $(mandir)/man8 install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man8dir) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-sbinPROGRAMS install-info: install-info-am install-man: install-man8 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS uninstall-man: uninstall-man8 .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-man8 install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ tags uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-man8 uninstall-sbinPROGRAMS dnet.8.txt: dnet.8 groff -t -e -mdoc -Tascii dnet.8 | col -bx > $@ # 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: libdnet-1.12/test/dnet/mod.h0000644000076500007650000000073307451002237017072 0ustar dugsongdugsong00000000000000/* * mod.h * * Copyright (c) 2002 Dug Song * * $Id: mod.h 316 2002-03-29 06:07:27Z dugsong $ */ #ifndef MOD_H #define MOD_H struct mod { char *name; int type; int (*main)(int argc, char *argv[]); }; /* * Module types */ #define MOD_TYPE_DATA 0x01 /* generate data */ #define MOD_TYPE_ENCAP 0x02 /* encapsulate data */ #define MOD_TYPE_XMIT 0x04 /* send datagrams */ #define MOD_TYPE_KERN 0x08 /* kernel network info */ #endif /* MOD_H */ libdnet-1.12/test/dnet/rand.c0000644000076500007650000000152507451002265017233 0ustar dugsongdugsong00000000000000/* * rand.c * * Copyright (c) 2001 Dug Song * * $Id: rand.c 317 2002-03-29 06:07:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "mod.h" void rand_usage(void) { fprintf(stderr, "Usage: dnet rand \n"); exit(1); } int rand_main(int argc, char *argv[]) { rand_t *r; int len; u_char *p; if (argc != 2 || *(argv[1]) == '-') rand_usage(); if ((len = atoi(argv[1])) == 0) rand_usage(); if ((p = malloc(len)) == NULL) err(1, "malloc"); if ((r = rand_open()) == NULL) err(1, "rand_init"); if (rand_get(r, p, len) < 0) err(1, "rand_get"); if (write(STDOUT_FILENO, p, len) != len) err(1, "write"); return (0); } struct mod mod_rand = { "rand", MOD_TYPE_DATA, rand_main }; libdnet-1.12/test/dnet/route.c0000644000076500007650000000431207450775224017455 0ustar dugsongdugsong00000000000000/* * route.c * * Copyright (c) 2001 Dug Song * * $Id: route.c 311 2002-03-29 05:24:36Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static void usage(void) { fprintf(stderr, "Usage: dnet route show\n" " dnet route get \n" " dnet route add \n" " dnet route delete \n"); exit(1); } static int print_route(const struct route_entry *entry, void *arg) { printf("%-20s %-20s\n", addr_ntoa(&entry->route_dst), addr_ntoa(&entry->route_gw)); return (0); } int route_main(int argc, char *argv[]) { struct route_entry entry; route_t *r; char *cmd; if (argc < 2) usage(); cmd = argv[1]; if ((r = route_open()) == NULL) err(1, "route_open"); if (strcmp(cmd, "show") == 0) { printf("%-20s %-20s\n", "Destination", "Gateway"); if (route_loop(r, print_route, NULL) < 0) err(1, "route_loop"); } else if (strcmp(cmd, "get") == 0) { if (addr_aton(argv[2], &entry.route_dst) < 0) err(1, "addr_aton"); if (route_get(r, &entry) < 0) err(1, "route_get"); printf("get %s %s: gateway %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst), addr_ntoa(&entry.route_gw)); } else if (strcmp(cmd, "add") == 0) { if (argc < 4 || addr_aton(argv[2], &entry.route_dst) < 0 || addr_aton(argv[3], &entry.route_gw) < 0) err(1, "addr_aton"); if (route_add(r, &entry) < 0) err(1, "route_add"); printf("add %s %s: gateway %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst), addr_ntoa(&entry.route_gw)); } else if (strcmp(cmd, "delete") == 0) { if (addr_aton(argv[2], &entry.route_dst) < 0) err(1, "addr_aton"); if (route_delete(r, &entry) < 0) err(1, "route_delete"); printf("delete %s %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst)); } else usage(); route_close(r); exit(0); } struct mod mod_route = { "route", MOD_TYPE_KERN, route_main }; libdnet-1.12/test/dnet/send.c0000644000076500007650000000231407430700671017240 0ustar dugsongdugsong00000000000000/* * send.c * * Copyright (c) 2002 Dug Song * * $Id: send.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void send_usage(void) { fprintf(stderr, "Usage: dnet send []\n"); exit(1); } int send_main(int argc, char *argv[]) { eth_t *eth; ip_t *ip; u_char *p, buf[IP_LEN_MAX]; /* XXX */ int c, len; if (argc == 2 && *(argv[1]) == '-') send_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read packet to send from tty"); p = buf; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (argc == 1) { if ((ip = ip_open()) == NULL) err(1, "ip_open"); if (ip_send(ip, buf, len) != len) err(1, "ip_send"); ip_close(ip); } else if (argc == 2) { if ((eth = eth_open(argv[1])) == NULL) err(1, "eth_open"); if (eth_send(eth, buf, len) != len) err(1, "eth_send"); eth_close(eth); } else send_usage(); exit(0); } struct mod mod_send = { "send", MOD_TYPE_XMIT, send_main }; libdnet-1.12/test/dnet/tcp.c0000644000076500007650000000406007430700671017075 0ustar dugsongdugsong00000000000000/* * tcp.c * * Copyright (c) 2001 Dug Song * * $Id: tcp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void tcp_usage(void) { fprintf(stderr, "Usage: dnet tcp [sport|dport|flags|seq|ack|" "win|urp ] ...\n"); exit(1); } int tcp_main(int argc, char *argv[]) { struct tcp_hdr *tcp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); tcp = (struct tcp_hdr *)buf; memset(tcp, 0, sizeof(*tcp)); tcp->th_sport = rand() & 0xffff; tcp->th_dport = rand() & 0xffff; tcp->th_seq = rand(); tcp->th_ack = 0; tcp->th_off = 5; tcp->th_flags = TH_SYN; tcp->th_win = TCP_WIN_MAX; tcp->th_urp = 0; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "sport") == 0) { if (port_aton(value, &tcp->th_sport) < 0) tcp_usage(); } else if (strcmp(name, "dport") == 0) { if (port_aton(value, &tcp->th_dport) < 0) tcp_usage(); } else if (strcmp(name, "flags") == 0) { if (flags_aton(value, &tcp->th_flags) < 0) tcp_usage(); } else if (strcmp(name, "seq") == 0) { if (seq_aton(value, &tcp->th_seq) < 0) tcp_usage(); } else if (strcmp(name, "ack") == 0) { if (seq_aton(value, &tcp->th_ack) < 0) tcp_usage(); } else if (strcmp(name, "win") == 0) { if (port_aton(value, &tcp->th_win) < 0) tcp_usage(); } else if (strcmp(name, "urp") == 0) { if (port_aton(value, &tcp->th_urp) < 0) tcp_usage(); } else tcp_usage(); } argc -= c; argv += c; if (argc != 0) tcp_usage(); p = buf + TCP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_tcp = { "tcp", MOD_TYPE_ENCAP, &tcp_main }; libdnet-1.12/test/dnet/udp.c0000644000076500007650000000265407430700671017106 0ustar dugsongdugsong00000000000000/* * udp.c * * Copyright (c) 2001 Dug Song * * $Id: udp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void udp_usage(void) { fprintf(stderr, "Usage: dnet udp [sport|dport ] ...\n"); exit(1); } int udp_main(int argc, char *argv[]) { struct udp_hdr *udp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); udp = (struct udp_hdr *)buf; memset(udp, 0, sizeof(*udp)); udp->uh_sport = rand() & 0xffff; udp->uh_dport = rand() & 0xffff; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "sport") == 0) { if (port_aton(value, &udp->uh_sport) < 0) udp_usage(); } else if (strcmp(name, "dport") == 0) { if (port_aton(value, &udp->uh_dport) < 0) udp_usage(); } else udp_usage(); } argc -= c; argv += c; if (argc != 0) udp_usage(); p = buf + UDP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; udp->uh_ulen = htons(len); if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_udp = { "udp", MOD_TYPE_ENCAP, udp_main }; libdnet-1.12/test/Makefile.am0000644000076500007650000000017007530352364017246 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 361 2002-08-20 05:34:44Z dugsong $ include $(top_srcdir)/Makefile.am.common SUBDIRS = check dnet libdnet-1.12/test/Makefile.in0000644000076500007650000002421110363627052017256 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include SUBDIRS = check dnet subdir = test mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/THANKS0000644000076500007650000000450610205004103015127 0ustar dugsongdugsong00000000000000# $Id: THANKS 596 2005-02-17 02:58:11Z dugsong $ many thanks to all the folks who have contributed to libdnet: Thamer Al-Harbash excellent bug reports and fearless beta-testing Marc Bevand RFC 768 UDP zero-checksum fix Michael Coulter OpenBSD pfioc_pooladdr fix, pf rule deletion bug report Michael A. Davis win32 code cleanup Scott Dawson interface alias fix Ben Fleis constification and code cleanup Mike Frantzen dnet hex test module fix Markus Friedl BSD/OS testing and autoconf fixes Tangy Gnat missing queue.h Loren Gorden many thorough, detailed bug reports and fixes Eric Jackson OpenBSD-alpha testing Juan plugged BPF fd leak on failure K2 HP-UX, OSF1, UnixWare, Solaris x86, Slackware, etc. access Kirby Kuehl win32 and OpenBSD updates David Lee addr_btos() bugfixes Kuk-hyeon Lee C++ support fixes Robert Lowe Tru64 access, and allowing me to crash his machine Dominic Marks FreeBSD 5 ipfw port fixes Jose Nazario IRIX access, and allowing me to crash his machine Nergal TCP sequence number handling fixes Peter C. Norton Linux port fixes plaguez for convincing me to write this, and suffering my bad French NN Poster RPM spec file Niels Provos many bugfixes and much encouragement Andrew Reiter help with ipfw braindeath John S VPATH build bug report Federico Sacerdoti dotted-quad IPv4 netmask support in addr_pton() Mike Schiffman inspiration via libnet Matt Smart caught pastos Matt Sommers BSD/OS testing Mike Stolarchuk enlightening discussion of *ntoa optimizations Greg Taleck OpenBSD pf bug reporting Christophe Ternat route-bsd.c fork() bug report xs NetBSD testing libdnet-1.12/TODO0000644000076500007650000000621510204217253014716 0ustar dugsongdugsong00000000000000ipfw2 on FreeBSD/5 (5.1 has pf) optimize port wildcard rules for each firewall type - e.g. using ipf FR_NONE, pf PF_OP_NONE, etc. ipchains sleazy exec audit addr_ntos() for non-zero'd host bits make *_loop() prevent modification within loop, or modify only post-iteration prefix everything with dnet_*, maybe new API with common dnet_t handle? more documentation and example code ip-cooked.c: use RTM_RESOLVE for ip_lookup_mac() (GetBestInterface()?) add a way to enable ip forwarding? finish IPv6 support everywhere (fw, route, ip6, win32, etc.) reimplement win32 fw (lost with laptop hd crash!@#$%) NAT, ipsec interface? maybe Checkpoint FW-1 support, via OPSEC (hrr) --------+------+-----+-----+----+----+------+-------+-----+ | addr | arp | eth | fw | ip | intf | route | tun | --------+------+-----+-----+----+----+------+-------+-----+ openbsd | | | | | | | | | --------+------+-----+-----+----+----+------+-------+-----+ freebsd | | | | 1 | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ netbsd | | | | | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ linux | | | | | | | | | --------+------+-----+-----+----+----+------+-------+-----+ solaris | | | | 7 | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ macosx | | | | | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ irix | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ bsdi | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ tru64 | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ hp-ux | | | | 7 | | 3 | | - | --------+------+-----+-----+----+----+------+-------+-----+ win32 | | | | | | 3 | | - | --------+------+-----+-----+----+----+------+-------+-----+ unixware| | - | 2 | - | - | | 4 | - | --------+------+-----+-----+----+----+------+-------+-----+ aix | | 5 | - | - | - | | 6 | - | --------+------+-----+-----+----+----+------+-------+-----+ = works, tested 1 = ipfw support, but no ipfw2 ? = untested 2 = eth_send doesn't work - = unimplemented 3 = intf_set doesn't work 4 = route_loop only works 5 = arp_show doesn't work 6 = route_loop doesn't work 7 = IP Filter should work, but untested arp-{bsd,ioctl} both b0rked on unixware eth_send() doesn't allow src mac spoofing on MacOS X (no BIOCSHDRCMPLT) without patch (http://slagheap.net/etherspoof/), also b0rked on BSD/OS, says markus. not possible on Tru64? no support for ICMP code in ipfw, therefore none in fw-ipfw.c need reliable, legit HP-UX, Unixware, and AIX accounts with root access to finish the ports to those platforms. i'd be happy to port to other platforms also, given similar (temporary) access. $Id: TODO 582 2005-02-14 21:56:59Z dugsong $ libdnet-1.12/trunk/0000755000076500007650000000000010554406445015400 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/acconfig.h0000644000076500007650000000077610204314360017316 0ustar dugsongdugsong00000000000000@BOTTOM@ #include #ifdef HAVE_WINSOCK2_H # include # include #endif #ifdef __svr4__ # define BSD_COMP 1 #endif #if defined(__osf__) && !defined(_SOCKADDR_LEN) # define _SOCKADDR_LEN 1 #endif #ifndef HAVE_INET_PTON int inet_pton(int, const char *, void *); #endif #ifndef HAVE_STRLCAT int strlcat(char *, const char *, int); #endif #ifndef HAVE_STRLCPY int strlcpy(char *, const char *, int); #endif #ifndef HAVE_STRSEP char *strsep(char **, const char *); #endif libdnet-1.12/trunk/aclocal.m40000644000076500007650000102414510554405216017242 0ustar dugsongdugsong00000000000000# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... AC_PREREQ([2.52]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_][CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_][CC], defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_][CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_][CXX], defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 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. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.6.3])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break 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_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional \"$1\" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_PREREQ([2.52]) # serial 6 # 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. We must strip everything past the first ":", # and everything past the last "/". # _AM_DIRNAME(PATH) # ----------------- # Like AS_DIRNAME, only do it during macro expansion AC_DEFUN([_AM_DIRNAME], [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, m4_if(regexp([$1], [^/.*]), -1, [.], patsubst([$1], [^\(/\).*], [\1])), patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl ])# _AM_DIRNAME # The stamp files are numbered to have different names. # We could number them on a directory basis, but that's additional # complications, let's have a unique counter. m4_define([_AM_STAMP_Count], [0]) # _AM_STAMP(HEADER) # ----------------- # The name of the stamp file for HEADER. AC_DEFUN([_AM_STAMP], [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl AS_ESCAPE(_AM_DIRNAME(patsubst([$1], [:.*])))/stamp-h[]_AM_STAMP_Count]) # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) # ------------------------------------------------------------ # We used to try to get a real timestamp in stamp-h. But the fear is that # that will cause unnecessary cvs conflicts. AC_DEFUN([_AM_CONFIG_HEADER], [# Add the stamp file to the list of files AC keeps track of, # along with our hook. AC_CONFIG_HEADERS([$1], [# update the timestamp echo 'timestamp for $1' >"_AM_STAMP([$1])" $2], [$3]) ])# _AM_CONFIG_HEADER # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) # -------------------------------------------------------------- AC_DEFUN([AM_CONFIG_HEADER], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) ])# AM_CONFIG_HEADER # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) dnl dnl Check for 4.4 BSD sa_len member in sockaddr struct dnl dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN(AC_DNET_SOCKADDR_SA_LEN, [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_dnet_sockaddr_has_sa_len=yes, ac_cv_dnet_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_dnet_sockaddr_has_sa_len) if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr struct has sa_len.]) fi]) dnl dnl Check for sockaddr_in6 struct in dnl dnl usage: AC_DNET_SOCKADDR_IN6 dnl results: HAVE_SOCKADDR_IN6 dnl AC_DEFUN(AC_DNET_SOCKADDR_IN6, [AC_MSG_CHECKING(for sockaddr_in6 struct in ) AC_CACHE_VAL(ac_cv_dnet_netinet_in_h_has_sockaddr_in6, AC_TRY_COMPILE([ # include # include # include ], [struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6;], ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes, ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no)) AC_MSG_RESULT($ac_cv_dnet_netinet_in_h_has_sockaddr_in6) if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then AC_DEFINE(HAVE_SOCKADDR_IN6, 1, [Define if has sockaddr_in6 struct.]) fi]) dnl dnl Check for arp_dev member in arpreq struct dnl dnl usage: AC_DNET_ARPREQ_ARP_DEV dnl results: HAVE_ARPREQ_ARP_DEV (defined) dnl AC_DEFUN(AC_DNET_ARPREQ_ARP_DEV, [AC_MSG_CHECKING(for arp_dev in arpreq struct) AC_CACHE_VAL(ac_cv_dnet_arpreq_has_arp_dev, AC_TRY_COMPILE([ # include # include # include ], [void *p = ((struct arpreq *)0)->arp_dev], ac_cv_dnet_arpreq_has_arp_dev=yes, ac_cv_dnet_arpreq_has_arp_dev=no)) AC_MSG_RESULT($ac_cv_dnet_arpreq_has_arp_dev) if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then AC_DEFINE(HAVE_ARPREQ_ARP_DEV, 1, [Define if arpreq struct has arp_dev.]) fi]) dnl dnl Check for rt_msghdr struct in dnl dnl usage: AC_DNET_ROUTE_RT_MSGHDR dnl results: HAVE_ROUTE_RT_MSGHDR dnl AC_DEFUN(AC_DNET_ROUTE_RT_MSGHDR, [AC_MSG_CHECKING(for rt_msghdr struct in ) AC_CACHE_VAL(ac_cv_dnet_route_h_has_rt_msghdr, AC_TRY_COMPILE([ # include # include # include # include ], [struct rt_msghdr rtm; rtm.rtm_msglen = 0;], ac_cv_dnet_route_h_has_rt_msghdr=yes, ac_cv_dnet_route_h_has_rt_msghdr=no)) AC_MSG_RESULT($ac_cv_dnet_route_h_has_rt_msghdr) if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then AC_DEFINE(HAVE_ROUTE_RT_MSGHDR, 1, [Define if has rt_msghdr struct.]) fi]) dnl dnl Check for the Berkeley Packet Filter dnl dnl usage: AC_DNET_BSD_BPF dnl results: HAVE_BSD_BPF dnl AC_DEFUN(AC_DNET_BSD_BPF, [AC_MSG_CHECKING(for Berkeley Packet Filter) AC_CACHE_VAL(ac_cv_dnet_bsd_bpf, if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi) AC_MSG_RESULT($ac_cv_dnet_bsd_bpf) if test $ac_cv_dnet_bsd_bpf = yes ; then AC_DEFINE(HAVE_BSD_BPF, 1, [Define if you have the Berkeley Packet Filter.]) fi]) dnl dnl Check for the Linux /proc filesystem dnl dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl AC_DEFUN(AC_DNET_LINUX_PROCFS, [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_procfs) if test $ac_cv_dnet_linux_procfs = yes ; then AC_DEFINE(HAVE_LINUX_PROCFS, 1, [Define if you have the Linux /proc filesystem.]) fi]) dnl dnl Check for Linux PF_PACKET sockets dnl dnl usage: AC_DNET_LINUX_PF_PACKET dnl results: HAVE_LINUX_PF_PACKET dnl AC_DEFUN(AC_DNET_LINUX_PF_PACKET, [AC_MSG_CHECKING(for Linux PF_PACKET sockets) AC_CACHE_VAL(ac_cv_dnet_linux_pf_packet, if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_pf_packet) if test $ac_cv_dnet_linux_pf_packet = yes ; then AC_DEFINE(HAVE_LINUX_PF_PACKET, 1, [Define if you have Linux PF_PACKET sockets.]) fi]) dnl dnl Check for SNMP MIB2 STREAMS (Solaris only?) dnl dnl usage: AC_DNET_STREAMS_MIB2 dnl results: HAVE_STREAMS_MIB2 dnl AC_DEFUN(AC_DNET_STREAMS_MIB2, [AC_MSG_CHECKING(for SNMP MIB2 STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_mib2, if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_mib2) if test $ac_cv_dnet_streams_mib2 = yes ; then AC_DEFINE(HAVE_STREAMS_MIB2, 1, [Define if you have SNMP MIB2 STREAMS.]) fi]) dnl dnl Check for route(7) STREAMS (UnixWare only?) dnl dnl usage: AC_DNET_STREAMS_ROUTE dnl results: HAVE_STREAMS_ROUTE dnl AC_DEFUN(AC_DNET_STREAMS_ROUTE, [AC_MSG_CHECKING(for route(7) STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_route, if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_route) if test $ac_cv_dnet_streams_route = yes ; then AC_DEFINE(HAVE_STREAMS_ROUTE, 1, [Define if you have route(7) STREAMS.]) fi]) dnl dnl Check for arp(7) ioctls dnl dnl usage: AC_DNET_IOCTL_ARP dnl results: HAVE_IOCTL_ARP dnl AC_DEFUN(AC_DNET_IOCTL_ARP, [AC_MSG_CHECKING(for arp(7) ioctls) AC_CACHE_VAL(ac_cv_dnet_ioctl_arp, AC_EGREP_CPP(werd, [ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif], ac_cv_dnet_ioctl_arp=yes, ac_cv_dnet_ioctl_arp=no)) case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac AC_MSG_RESULT($ac_cv_dnet_ioctl_arp) if test $ac_cv_dnet_ioctl_arp = yes ; then AC_DEFINE(HAVE_IOCTL_ARP, 1, [Define if you have arp(7) ioctls.]) fi]) dnl dnl Check for raw IP sockets ip_{len,off} host byte ordering dnl dnl usage: AC_DNET_RAWIP_HOST_OFFLEN dnl results: HAVE_RAWIP_HOST_OFFLEN dnl AC_DEFUN(AC_DNET_RAWIP_HOST_OFFLEN, [AC_MSG_CHECKING([for raw IP sockets ip_{len,off} host byte ordering]) AC_CACHE_VAL(ac_cv_dnet_rawip_host_offlen, [ case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_host_offlen) if test $ac_cv_dnet_rawip_host_offlen = yes ; then AC_DEFINE(HAVE_RAWIP_HOST_OFFLEN, 1, [Define if raw IP sockets require host byte ordering for ip_off, ip_len.]) fi]) dnl dnl Check for cooked raw IP sockets dnl dnl usage: AC_DNET_RAWIP_COOKED dnl results: HAVE_RAWIP_COOKED dnl AC_DEFUN(AC_DNET_RAWIP_COOKED, [AC_MSG_CHECKING(for cooked raw IP sockets) AC_CACHE_VAL(ac_cv_dnet_rawip_cooked, [ case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_cooked) if test $ac_cv_dnet_rawip_cooked = yes ; then AC_DEFINE(HAVE_RAWIP_COOKED, 1, [Define if you have cooked raw IP sockets.]) fi]) dnl dnl AC_LBL_LIBRARY_NET dnl dnl This test is for network applications that need socket() and dnl gethostbyname() -ish functions. Under Solaris, those applications dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link dnl with "-lnsl" but should *not* link with "-lsocket" because dnl libsocket.a breaks a number of things (for instance: dnl gethostbyname() under IRIX 5.2, and snoop sockets under most dnl versions of IRIX). dnl dnl Unfortunately, many application developers are not aware of this, dnl and mistakenly write tests that cause -lsocket to be used under dnl IRIX. It is also easy to write tests that cause -lnsl to be used dnl under operating systems where neither are necessary (or useful), dnl such as SunOS 4.1.4, which uses -lnsl for TLI. dnl dnl This test exists so that every application developer does not test dnl this in a different, and subtly broken fashion. dnl It has been argued that this test should be broken up into two dnl seperate tests, one for the resolver libraries, and one for the dnl libraries necessary for using Sockets API. Unfortunately, the two dnl are carefully intertwined and allowing the autoconf user to use dnl them independantly potentially results in unfortunate ordering dnl dependancies -- as such, such component macros would have to dnl carefully use indirection and be aware if the other components were dnl executed. Since other autoconf macros do not go to this trouble, dnl and almost no applications use sockets without the resolver, this dnl complexity has not been implemented. dnl dnl The check for libresolv is in case you are attempting to link dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl AC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , # Some OSes (eg. Solaris) place it in libnsl: AC_CHECK_LIB(nsl, gethostbyname, , # Some strange OSes (SINIX) have it in libsocket: AC_CHECK_LIB(socket, gethostbyname, , # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", AC_CHECK_LIB(resolv, gethostbyname), -lnsl)))) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_CHECK_LIB(str, putmsg) ]) libdnet-1.12/trunk/config/0000755000076500007650000000000010554406444016644 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/config/acinclude.m40000644000076500007650000002465610552362272021050 0ustar dugsongdugsong00000000000000dnl dnl Check for 4.4 BSD sa_len member in sockaddr struct dnl dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN(AC_DNET_SOCKADDR_SA_LEN, [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_dnet_sockaddr_has_sa_len=yes, ac_cv_dnet_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_dnet_sockaddr_has_sa_len) if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr struct has sa_len.]) fi]) dnl dnl Check for sockaddr_in6 struct in dnl dnl usage: AC_DNET_SOCKADDR_IN6 dnl results: HAVE_SOCKADDR_IN6 dnl AC_DEFUN(AC_DNET_SOCKADDR_IN6, [AC_MSG_CHECKING(for sockaddr_in6 struct in ) AC_CACHE_VAL(ac_cv_dnet_netinet_in_h_has_sockaddr_in6, AC_TRY_COMPILE([ # include # include # include ], [struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6;], ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes, ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no)) AC_MSG_RESULT($ac_cv_dnet_netinet_in_h_has_sockaddr_in6) if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then AC_DEFINE(HAVE_SOCKADDR_IN6, 1, [Define if has sockaddr_in6 struct.]) fi]) dnl dnl Check for arp_dev member in arpreq struct dnl dnl usage: AC_DNET_ARPREQ_ARP_DEV dnl results: HAVE_ARPREQ_ARP_DEV (defined) dnl AC_DEFUN(AC_DNET_ARPREQ_ARP_DEV, [AC_MSG_CHECKING(for arp_dev in arpreq struct) AC_CACHE_VAL(ac_cv_dnet_arpreq_has_arp_dev, AC_TRY_COMPILE([ # include # include # include ], [void *p = ((struct arpreq *)0)->arp_dev], ac_cv_dnet_arpreq_has_arp_dev=yes, ac_cv_dnet_arpreq_has_arp_dev=no)) AC_MSG_RESULT($ac_cv_dnet_arpreq_has_arp_dev) if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then AC_DEFINE(HAVE_ARPREQ_ARP_DEV, 1, [Define if arpreq struct has arp_dev.]) fi]) dnl dnl Check for rt_msghdr struct in dnl dnl usage: AC_DNET_ROUTE_RT_MSGHDR dnl results: HAVE_ROUTE_RT_MSGHDR dnl AC_DEFUN(AC_DNET_ROUTE_RT_MSGHDR, [AC_MSG_CHECKING(for rt_msghdr struct in ) AC_CACHE_VAL(ac_cv_dnet_route_h_has_rt_msghdr, AC_TRY_COMPILE([ # include # include # include # include ], [struct rt_msghdr rtm; rtm.rtm_msglen = 0;], ac_cv_dnet_route_h_has_rt_msghdr=yes, ac_cv_dnet_route_h_has_rt_msghdr=no)) AC_MSG_RESULT($ac_cv_dnet_route_h_has_rt_msghdr) if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then AC_DEFINE(HAVE_ROUTE_RT_MSGHDR, 1, [Define if has rt_msghdr struct.]) fi]) dnl dnl Check for the Berkeley Packet Filter dnl dnl usage: AC_DNET_BSD_BPF dnl results: HAVE_BSD_BPF dnl AC_DEFUN(AC_DNET_BSD_BPF, [AC_MSG_CHECKING(for Berkeley Packet Filter) AC_CACHE_VAL(ac_cv_dnet_bsd_bpf, if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi) AC_MSG_RESULT($ac_cv_dnet_bsd_bpf) if test $ac_cv_dnet_bsd_bpf = yes ; then AC_DEFINE(HAVE_BSD_BPF, 1, [Define if you have the Berkeley Packet Filter.]) fi]) dnl dnl Check for the Linux /proc filesystem dnl dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl AC_DEFUN(AC_DNET_LINUX_PROCFS, [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_procfs) if test $ac_cv_dnet_linux_procfs = yes ; then AC_DEFINE(HAVE_LINUX_PROCFS, 1, [Define if you have the Linux /proc filesystem.]) fi]) dnl dnl Check for Linux PF_PACKET sockets dnl dnl usage: AC_DNET_LINUX_PF_PACKET dnl results: HAVE_LINUX_PF_PACKET dnl AC_DEFUN(AC_DNET_LINUX_PF_PACKET, [AC_MSG_CHECKING(for Linux PF_PACKET sockets) AC_CACHE_VAL(ac_cv_dnet_linux_pf_packet, if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_pf_packet) if test $ac_cv_dnet_linux_pf_packet = yes ; then AC_DEFINE(HAVE_LINUX_PF_PACKET, 1, [Define if you have Linux PF_PACKET sockets.]) fi]) dnl dnl Check for SNMP MIB2 STREAMS (Solaris only?) dnl dnl usage: AC_DNET_STREAMS_MIB2 dnl results: HAVE_STREAMS_MIB2 dnl AC_DEFUN(AC_DNET_STREAMS_MIB2, [AC_MSG_CHECKING(for SNMP MIB2 STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_mib2, if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_mib2) if test $ac_cv_dnet_streams_mib2 = yes ; then AC_DEFINE(HAVE_STREAMS_MIB2, 1, [Define if you have SNMP MIB2 STREAMS.]) fi]) dnl dnl Check for route(7) STREAMS (UnixWare only?) dnl dnl usage: AC_DNET_STREAMS_ROUTE dnl results: HAVE_STREAMS_ROUTE dnl AC_DEFUN(AC_DNET_STREAMS_ROUTE, [AC_MSG_CHECKING(for route(7) STREAMS) AC_CACHE_VAL(ac_cv_dnet_streams_route, if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi) AC_MSG_RESULT($ac_cv_dnet_streams_route) if test $ac_cv_dnet_streams_route = yes ; then AC_DEFINE(HAVE_STREAMS_ROUTE, 1, [Define if you have route(7) STREAMS.]) fi]) dnl dnl Check for arp(7) ioctls dnl dnl usage: AC_DNET_IOCTL_ARP dnl results: HAVE_IOCTL_ARP dnl AC_DEFUN(AC_DNET_IOCTL_ARP, [AC_MSG_CHECKING(for arp(7) ioctls) AC_CACHE_VAL(ac_cv_dnet_ioctl_arp, AC_EGREP_CPP(werd, [ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif], ac_cv_dnet_ioctl_arp=yes, ac_cv_dnet_ioctl_arp=no)) case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac AC_MSG_RESULT($ac_cv_dnet_ioctl_arp) if test $ac_cv_dnet_ioctl_arp = yes ; then AC_DEFINE(HAVE_IOCTL_ARP, 1, [Define if you have arp(7) ioctls.]) fi]) dnl dnl Check for raw IP sockets ip_{len,off} host byte ordering dnl dnl usage: AC_DNET_RAWIP_HOST_OFFLEN dnl results: HAVE_RAWIP_HOST_OFFLEN dnl AC_DEFUN(AC_DNET_RAWIP_HOST_OFFLEN, [AC_MSG_CHECKING([for raw IP sockets ip_{len,off} host byte ordering]) AC_CACHE_VAL(ac_cv_dnet_rawip_host_offlen, [ case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_host_offlen) if test $ac_cv_dnet_rawip_host_offlen = yes ; then AC_DEFINE(HAVE_RAWIP_HOST_OFFLEN, 1, [Define if raw IP sockets require host byte ordering for ip_off, ip_len.]) fi]) dnl dnl Check for cooked raw IP sockets dnl dnl usage: AC_DNET_RAWIP_COOKED dnl results: HAVE_RAWIP_COOKED dnl AC_DEFUN(AC_DNET_RAWIP_COOKED, [AC_MSG_CHECKING(for cooked raw IP sockets) AC_CACHE_VAL(ac_cv_dnet_rawip_cooked, [ case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac]) AC_MSG_RESULT($ac_cv_dnet_rawip_cooked) if test $ac_cv_dnet_rawip_cooked = yes ; then AC_DEFINE(HAVE_RAWIP_COOKED, 1, [Define if you have cooked raw IP sockets.]) fi]) dnl dnl AC_LBL_LIBRARY_NET dnl dnl This test is for network applications that need socket() and dnl gethostbyname() -ish functions. Under Solaris, those applications dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link dnl with "-lnsl" but should *not* link with "-lsocket" because dnl libsocket.a breaks a number of things (for instance: dnl gethostbyname() under IRIX 5.2, and snoop sockets under most dnl versions of IRIX). dnl dnl Unfortunately, many application developers are not aware of this, dnl and mistakenly write tests that cause -lsocket to be used under dnl IRIX. It is also easy to write tests that cause -lnsl to be used dnl under operating systems where neither are necessary (or useful), dnl such as SunOS 4.1.4, which uses -lnsl for TLI. dnl dnl This test exists so that every application developer does not test dnl this in a different, and subtly broken fashion. dnl It has been argued that this test should be broken up into two dnl seperate tests, one for the resolver libraries, and one for the dnl libraries necessary for using Sockets API. Unfortunately, the two dnl are carefully intertwined and allowing the autoconf user to use dnl them independantly potentially results in unfortunate ordering dnl dependancies -- as such, such component macros would have to dnl carefully use indirection and be aware if the other components were dnl executed. Since other autoconf macros do not go to this trouble, dnl and almost no applications use sockets without the resolver, this dnl complexity has not been implemented. dnl dnl The check for libresolv is in case you are attempting to link dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl AC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): AC_CHECK_FUNC(gethostbyname, , # Some OSes (eg. Solaris) place it in libnsl: AC_CHECK_LIB(nsl, gethostbyname, , # Some strange OSes (SINIX) have it in libsocket: AC_CHECK_LIB(socket, gethostbyname, , # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", AC_CHECK_LIB(resolv, gethostbyname), -lnsl)))) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_CHECK_LIB(str, putmsg) ]) libdnet-1.12/trunk/config/config.guess0000755000076500007650000012701210554404354021165 0ustar dugsongdugsong00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-01-15' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libdnet-1.12/trunk/config/config.sub0000755000076500007650000007763110554404354020643 0ustar dugsongdugsong00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-01-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libdnet-1.12/trunk/config/install-sh0000755000076500007650000001270110363626525020653 0ustar dugsongdugsong00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 libdnet-1.12/trunk/config/libtool.m40000644000076500007650000070230210554405161020551 0ustar dugsongdugsong00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 ## Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This file is free software; the Free Software Foundation gives ## unlimited permission to copy and/or distribute it, with or without ## modifications, as long as this notice is preserved. # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) libdnet-1.12/trunk/config/ltmain.sh0000644000076500007650000057753010554405161020500 0ustar dugsongdugsong00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.22 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libdnet-1.12/trunk/config/missing0000755000076500007650000002404010363626525020245 0ustar dugsongdugsong00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 libdnet-1.12/trunk/config/mkinstalldirs0000755000076500007650000000341110363626525021453 0ustar dugsongdugsong00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here libdnet-1.12/trunk/configure0000755000076500007650000273043710554405231017317 0ustar dugsongdugsong00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="include/dnet.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS ac_aux_dir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PYTHON TCLINC TCLLIB PYTHON_TRUE PYTHON_FALSE TCL_TRUE TCL_FALSE CHECKINC CHECKLIB HAVE_CHECK_TRUE HAVE_CHECK_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-python=DIR build Python module (using python in DIR) --with-wpdpack=DIR use WinPcap developer's pack in DIR --with-check=DIR use Check (http://check.sf.net) in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config $srcdir/config; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.6" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=libdnet VERSION=1.12 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Add the stamp file to the list of files AC keeps track of, # along with our hook. ac_config_headers="$ac_config_headers include/config.h" echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in *cygwin*) CYGWIN=yes;; *) CYGWIN=no;; esac if test "$prefix" = "NONE"; then prefix="/usr/local" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-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 or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-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; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 3700 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5259:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=yes enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6322: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6326: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6590: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6594: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6694: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6698: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11479: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11483: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11583: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11587: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13153: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13157: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13257: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13261: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15460: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15464: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15728: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15732: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15832: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15836: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking for Python" >&5 echo $ECHO_N "checking for Python... $ECHO_C" >&6 # Check whether --with-python or --without-python was given. if test "${with_python+set}" = set; then withval="$with_python" case "$withval" in yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 PYTHON="python" ;; no) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; *) echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 for subdir in . bin; do if test -x $withval/$subdir/python; then owd=`pwd` if cd $withval/$subdir; then withval=`pwd`; cd $owd; fi PYTHON="$withval/python" break fi done if test "x$PYTHON" = "x"; then { { echo "$as_me:$LINENO: error: python not found in $withval" >&5 echo "$as_me: error: python not found in $withval" >&2;} { (exit 1); exit 1; }; } fi ;; esac fi; if test "x$PYTHON" != "x"; then PYTHON_TRUE= PYTHON_FALSE='#' else PYTHON_TRUE='#' PYTHON_FALSE= fi if test "x$TCLINC" != "x"; then TCL_TRUE= TCL_FALSE='#' else TCL_TRUE='#' TCL_FALSE= fi if test -r /usr/include/sgidefs.h ; then CPPFLAGS="$CPPFLAGS -D__sgi" fi if test "$CYGWIN" = yes ; then if test -d /usr/include/mingw ; then CPPFLAGS="$CPPFLAGS -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin" cat >>confdefs.h <<\_ACEOF #define WIN32_LEAN_AND_MEAN 1 _ACEOF echo "$as_me:$LINENO: checking for main in -lws2_32" >&5 echo $ECHO_N "checking for main in -lws2_32... $ECHO_C" >&6 if test "${ac_cv_lib_ws2_32_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ws2_32_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ws2_32_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_main" >&5 echo "${ECHO_T}$ac_cv_lib_ws2_32_main" >&6 if test $ac_cv_lib_ws2_32_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi echo "$as_me:$LINENO: checking for main in -liphlpapi" >&5 echo $ECHO_N "checking for main in -liphlpapi... $ECHO_C" >&6 if test "${ac_cv_lib_iphlpapi_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_iphlpapi_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_iphlpapi_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_iphlpapi_main" >&5 echo "${ECHO_T}$ac_cv_lib_iphlpapi_main" >&6 if test $ac_cv_lib_iphlpapi_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi cat >>confdefs.h <<\_ACEOF #define snprintf _snprintf _ACEOF else { { echo "$as_me:$LINENO: error: need MingW32 package to build under Cygwin" >&5 echo "$as_me: error: need MingW32 package to build under Cygwin" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for WinPcap developer's pack" >&5 echo $ECHO_N "checking for WinPcap developer's pack... $ECHO_C" >&6 # Check whether --with-wpdpack or --without-wpdpack was given. if test "${with_wpdpack+set}" = set; then withval="$with_wpdpack" echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 if test -f $withval/include/packet32.h -a -f $withval/lib/packet.lib; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CFLAGS="$CFLAGS -I$withval/include" LIBS="$LIBS -L$withval/lib -lpacket" else { { echo "$as_me:$LINENO: error: packet32.h or packet.lib not found in $withval" >&5 echo "$as_me: error: packet32.h or packet.lib not found in $withval" >&2;} { (exit 1); exit 1; }; } fi else for dir in ${prefix} ${HOME}/WPdpack ; do if test -f ${dir}/include/packet32.h -a -f ${dir}/lib/packet.lib; then CFLAGS="$CFLAGS -I${dir}/include" LIBS="$LIBS -L${dir}/lib -lpacket" have_pcap=yes break; fi done if test "$have_pcap" != yes; then { { echo "$as_me:$LINENO: error: WinPcap developer's pack not found" >&5 echo "$as_me: error: WinPcap developer's pack not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi; fi if test "$CYGWIN" != yes ; then # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* 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_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else # Some OSes (eg. Solaris) place it in libnsl: echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" else # Some strange OSes (SINIX) have it in libsocket: echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5 echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6 if test $ac_cv_lib_socket_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" else # Unfortunately libsocket sometimes depends on libnsl. # AC_CHECK_LIB's API is essentially broken so the # following ugliness is necessary: echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5 echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6 if test $ac_cv_lib_socket_gethostbyname = yes; then LIBS="-lsocket -lnsl $LIBS" else echo "$as_me:$LINENO: checking for gethostbyname in -lresolv" >&5 echo $ECHO_N "checking for gethostbyname in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_gethostbyname" >&6 if test $ac_cv_lib_resolv_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi fi fi fi fi echo "$as_me:$LINENO: checking for socket" >&5 echo $ECHO_N "checking for socket... $ECHO_C" >&6 if test "${ac_cv_func_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define socket to an innocuous variant, in case declares socket. For example, HP-UX 11i declares gettimeofday. */ #define socket innocuous_socket /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef socket /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); /* 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_socket) || defined (__stub___socket) choke me #else char (*f) () = socket; #endif #ifdef __cplusplus } #endif int main () { return f != socket; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5 echo "${ECHO_T}$ac_cv_func_socket" >&6 if test $ac_cv_func_socket = yes; then : else echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" else echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket -lnsl $LIBS" fi fi fi # DLPI needs putmsg under HPUX so test for -lstr while we're at it echo "$as_me:$LINENO: checking for putmsg in -lstr" >&5 echo $ECHO_N "checking for putmsg in -lstr... $ECHO_C" >&6 if test "${ac_cv_lib_str_putmsg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lstr $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char putmsg (); int main () { putmsg (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_str_putmsg=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_str_putmsg=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_str_putmsg" >&5 echo "${ECHO_T}$ac_cv_lib_str_putmsg" >&6 if test $ac_cv_lib_str_putmsg = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSTR 1 _ACEOF LIBS="-lstr $LIBS" fi echo "$as_me:$LINENO: checking for open_mib in -lnm" >&5 echo $ECHO_N "checking for open_mib in -lnm... $ECHO_C" >&6 if test "${ac_cv_lib_nm_open_mib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char open_mib (); int main () { open_mib (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nm_open_mib=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nm_open_mib=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nm_open_mib" >&5 echo "${ECHO_T}$ac_cv_lib_nm_open_mib" >&6 if test $ac_cv_lib_nm_open_mib = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNM 1 _ACEOF LIBS="-lnm $LIBS" fi fi echo "$as_me:$LINENO: checking for Check" >&5 echo $ECHO_N "checking for Check... $ECHO_C" >&6 # Check whether --with-check or --without-check was given. if test "${with_check+set}" = set; then withval="$with_check" case "$withval" in yes|no) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; *) echo "$as_me:$LINENO: result: $withval" >&5 echo "${ECHO_T}$withval" >&6 if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/include" CHECKLIB="-L$withval/lib -lcheck" elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/src" CHECKLIB="-L$withval/src -lcheck" else { { echo "$as_me:$LINENO: error: check.h or libcheck.a not found in $withval" >&5 echo "$as_me: error: check.h or libcheck.a not found in $withval" >&2;} { (exit 1); exit 1; }; } fi ;; esac else if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then CHECKINC="-I${prefix}/include" CHECKLIB="-L${prefix}/lib -lcheck" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi; if test "x$CHECKLIB" != "x"; then HAVE_CHECK_TRUE= HAVE_CHECK_FALSE='#' else HAVE_CHECK_TRUE='#' HAVE_CHECK_FALSE= fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi if test "$CYGWIN" = yes ; then for ac_header in Iphlpapi.h winsock2.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else for ac_header in fcntl.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h \ sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h \ sys/sysctl.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in net/bpf.h net/if.h net/if_var.h \ net/if_arp.h net/if_dl.h net/pfilt.h \ net/pfvar.h net/radix.h net/raw.h net/route.h netinet/in_var.h \ net/if_tun.h linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h \ linux/ip_fwchains.h linux/netfilter_ipv4/ipchains_core.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h \ netinet/ip_compat.h ip_fil.h netinet/ip_fil.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in hpsecurity.h stropts.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for sockaddr_in6 struct in " >&5 echo $ECHO_N "checking for sockaddr_in6 struct in ... $ECHO_C" >&6 if test "${ac_cv_dnet_netinet_in_h_has_sockaddr_in6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_netinet_in_h_has_sockaddr_in6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_netinet_in_h_has_sockaddr_in6=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_netinet_in_h_has_sockaddr_in6" >&5 echo "${ECHO_T}$ac_cv_dnet_netinet_in_h_has_sockaddr_in6" >&6 if test $ac_cv_dnet_netinet_in_h_has_sockaddr_in6 = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_IN6 1 _ACEOF fi if test "$ac_cv_header_sys_socket_h" = yes ; then echo "$as_me:$LINENO: checking for sa_len in sockaddr struct" >&5 echo $ECHO_N "checking for sa_len in sockaddr struct... $ECHO_C" >&6 if test "${ac_cv_dnet_sockaddr_has_sa_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # ifndef _SOCKADDR_LEN # define _SOCKADDR_LEN 1 # endif # include # include int main () { u_int i = sizeof(((struct sockaddr *)0)->sa_len) ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_sockaddr_has_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_sockaddr_has_sa_len=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_sockaddr_has_sa_len" >&5 echo "${ECHO_T}$ac_cv_dnet_sockaddr_has_sa_len" >&6 if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF fi fi if test "$ac_cv_header_net_if_arp_h" = yes ; then echo "$as_me:$LINENO: checking for arp_dev in arpreq struct" >&5 echo $ECHO_N "checking for arp_dev in arpreq struct... $ECHO_C" >&6 if test "${ac_cv_dnet_arpreq_has_arp_dev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { void *p = ((struct arpreq *)0)->arp_dev ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_arpreq_has_arp_dev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_arpreq_has_arp_dev=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_arpreq_has_arp_dev" >&5 echo "${ECHO_T}$ac_cv_dnet_arpreq_has_arp_dev" >&6 if test $ac_cv_dnet_arpreq_has_arp_dev = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_ARPREQ_ARP_DEV 1 _ACEOF fi fi if test "$ac_cv_header_net_route_h" = yes ; then echo "$as_me:$LINENO: checking for rt_msghdr struct in " >&5 echo $ECHO_N "checking for rt_msghdr struct in ... $ECHO_C" >&6 if test "${ac_cv_dnet_route_h_has_rt_msghdr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include # include int main () { struct rt_msghdr rtm; rtm.rtm_msglen = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_dnet_route_h_has_rt_msghdr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dnet_route_h_has_rt_msghdr=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_dnet_route_h_has_rt_msghdr" >&5 echo "${ECHO_T}$ac_cv_dnet_route_h_has_rt_msghdr" >&6 if test $ac_cv_dnet_route_h_has_rt_msghdr = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_ROUTE_RT_MSGHDR 1 _ACEOF fi fi if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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 echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_func in err strlcat strlcpy strsep do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case $LIBOBJS in "$ac_func.$ac_objext" | \ *" $ac_func.$ac_objext" | \ "$ac_func.$ac_objext "* | \ *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test "$CYGWIN" != yes ; then echo "$as_me:$LINENO: checking for Berkeley Packet Filter" >&5 echo $ECHO_N "checking for Berkeley Packet Filter... $ECHO_C" >&6 if test "${ac_cv_dnet_bsd_bpf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -c /dev/bpf0 ; then ac_cv_dnet_bsd_bpf=yes else ac_cv_dnet_bsd_bpf=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_bsd_bpf" >&5 echo "${ECHO_T}$ac_cv_dnet_bsd_bpf" >&6 if test $ac_cv_dnet_bsd_bpf = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_BSD_BPF 1 _ACEOF fi echo "$as_me:$LINENO: checking for Linux proc filesystem" >&5 echo $ECHO_N "checking for Linux proc filesystem... $ECHO_C" >&6 if test "${ac_cv_dnet_linux_procfs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_linux_procfs" >&5 echo "${ECHO_T}$ac_cv_dnet_linux_procfs" >&6 if test $ac_cv_dnet_linux_procfs = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PROCFS 1 _ACEOF fi echo "$as_me:$LINENO: checking for Linux PF_PACKET sockets" >&5 echo $ECHO_N "checking for Linux PF_PACKET sockets... $ECHO_C" >&6 if test "${ac_cv_dnet_linux_pf_packet+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/include/netpacket/packet.h ; then ac_cv_dnet_linux_pf_packet=yes else ac_cv_dnet_linux_pf_packet=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_linux_pf_packet" >&5 echo "${ECHO_T}$ac_cv_dnet_linux_pf_packet" >&6 if test $ac_cv_dnet_linux_pf_packet = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_PF_PACKET 1 _ACEOF fi echo "$as_me:$LINENO: checking for SNMP MIB2 STREAMS" >&5 echo $ECHO_N "checking for SNMP MIB2 STREAMS... $ECHO_C" >&6 if test "${ac_cv_dnet_streams_mib2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/include/inet/mib2.h -a -c /dev/ip ; then ac_cv_dnet_streams_mib2=yes else ac_cv_dnet_streams_mib2=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_streams_mib2" >&5 echo "${ECHO_T}$ac_cv_dnet_streams_mib2" >&6 if test $ac_cv_dnet_streams_mib2 = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STREAMS_MIB2 1 _ACEOF fi echo "$as_me:$LINENO: checking for route(7) STREAMS" >&5 echo $ECHO_N "checking for route(7) STREAMS... $ECHO_C" >&6 if test "${ac_cv_dnet_streams_route+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if grep RTSTR_SEND /usr/include/net/route.h >/dev/null 2>&1 ; then ac_cv_dnet_streams_route=yes else ac_cv_dnet_streams_route=no fi fi echo "$as_me:$LINENO: result: $ac_cv_dnet_streams_route" >&5 echo "${ECHO_T}$ac_cv_dnet_streams_route" >&6 if test $ac_cv_dnet_streams_route = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STREAMS_ROUTE 1 _ACEOF fi echo "$as_me:$LINENO: checking for arp(7) ioctls" >&5 echo $ECHO_N "checking for arp(7) ioctls... $ECHO_C" >&6 if test "${ac_cv_dnet_ioctl_arp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # define BSD_COMP # include # ifdef SIOCGARP werd # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "werd" >/dev/null 2>&1; then ac_cv_dnet_ioctl_arp=yes else ac_cv_dnet_ioctl_arp=no fi rm -f conftest* fi case "$host_os" in irix*) ac_cv_dnet_ioctl_arp=no ;; esac echo "$as_me:$LINENO: result: $ac_cv_dnet_ioctl_arp" >&5 echo "${ECHO_T}$ac_cv_dnet_ioctl_arp" >&6 if test $ac_cv_dnet_ioctl_arp = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_IOCTL_ARP 1 _ACEOF fi echo "$as_me:$LINENO: checking for raw IP sockets ip_{len,off} host byte ordering" >&5 echo $ECHO_N "checking for raw IP sockets ip_{len,off} host byte ordering... $ECHO_C" >&6 if test "${ac_cv_dnet_rawip_host_offlen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$host_os" in *openbsd*) ac_cv_dnet_rawip_host_offlen=no ;; *bsd*|*darwin*|*osf*|*unixware*) ac_cv_dnet_rawip_host_offlen=yes ;; *) ac_cv_dnet_rawip_host_offlen=no ;; esac fi echo "$as_me:$LINENO: result: $ac_cv_dnet_rawip_host_offlen" >&5 echo "${ECHO_T}$ac_cv_dnet_rawip_host_offlen" >&6 if test $ac_cv_dnet_rawip_host_offlen = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_RAWIP_HOST_OFFLEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for cooked raw IP sockets" >&5 echo $ECHO_N "checking for cooked raw IP sockets... $ECHO_C" >&6 if test "${ac_cv_dnet_rawip_cooked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$host_os" in solaris*|irix*) ac_cv_dnet_rawip_cooked=yes ;; *) ac_cv_dnet_rawip_cooked=no ;; esac fi echo "$as_me:$LINENO: result: $ac_cv_dnet_rawip_cooked" >&5 echo "${ECHO_T}$ac_cv_dnet_rawip_cooked" >&6 if test $ac_cv_dnet_rawip_cooked = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_RAWIP_COOKED 1 _ACEOF fi fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "arp-win32.$ac_objext" | \ *" arp-win32.$ac_objext" | \ "arp-win32.$ac_objext "* | \ *" arp-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_ioctl_arp" = yes ; then case $LIBOBJS in "arp-ioctl.$ac_objext" | \ *" arp-ioctl.$ac_objext" | \ "arp-ioctl.$ac_objext "* | \ *" arp-ioctl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-ioctl.$ac_objext" ;; esac elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then case $LIBOBJS in "arp-bsd.$ac_objext" | \ *" arp-bsd.$ac_objext" | \ "arp-bsd.$ac_objext "* | \ *" arp-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-bsd.$ac_objext" ;; esac else case $LIBOBJS in "arp-none.$ac_objext" | \ *" arp-none.$ac_objext" | \ "arp-none.$ac_objext "* | \ *" arp-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS arp-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "eth-win32.$ac_objext" | \ *" eth-win32.$ac_objext" | \ "eth-win32.$ac_objext "* | \ *" eth-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-win32.$ac_objext" ;; esac elif test "$ac_cv_header_net_pfilt_h" = yes ; then case $LIBOBJS in "eth-pfilt.$ac_objext" | \ *" eth-pfilt.$ac_objext" | \ "eth-pfilt.$ac_objext "* | \ *" eth-pfilt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-pfilt.$ac_objext" ;; esac elif test "$ac_cv_dnet_bsd_bpf" = yes ; then case $LIBOBJS in "eth-bsd.$ac_objext" | \ *" eth-bsd.$ac_objext" | \ "eth-bsd.$ac_objext "* | \ *" eth-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-bsd.$ac_objext" ;; esac elif test "$ac_cv_dnet_linux_pf_packet" = yes ; then case $LIBOBJS in "eth-linux.$ac_objext" | \ *" eth-linux.$ac_objext" | \ "eth-linux.$ac_objext "* | \ *" eth-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-linux.$ac_objext" ;; esac elif test "$ac_cv_header_net_raw_h" = yes ; then case $LIBOBJS in "eth-snoop.$ac_objext" | \ *" eth-snoop.$ac_objext" | \ "eth-snoop.$ac_objext "* | \ *" eth-snoop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-snoop.$ac_objext" ;; esac elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then case $LIBOBJS in "eth-ndd.$ac_objext" | \ *" eth-ndd.$ac_objext" | \ "eth-ndd.$ac_objext "* | \ *" eth-ndd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-ndd.$ac_objext" ;; esac elif test "$ac_cv_header_sys_dlpi_h" = yes || \ test "$ac_cv_header_sys_dlpihdr_h" = yes ; then case $LIBOBJS in "eth-dlpi.$ac_objext" | \ *" eth-dlpi.$ac_objext" | \ "eth-dlpi.$ac_objext "* | \ *" eth-dlpi.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-dlpi.$ac_objext" ;; esac else case $LIBOBJS in "eth-none.$ac_objext" | \ *" eth-none.$ac_objext" | \ "eth-none.$ac_objext "* | \ *" eth-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS eth-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "fw-pktfilter.$ac_objext" | \ *" fw-pktfilter.$ac_objext" | \ "fw-pktfilter.$ac_objext "* | \ *" fw-pktfilter.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-pktfilter.$ac_objext" ;; esac elif test "$ac_cv_header_net_pfvar_h" = yes ; then case $LIBOBJS in "fw-pf.$ac_objext" | \ *" fw-pf.$ac_objext" | \ "fw-pf.$ac_objext "* | \ *" fw-pf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-pf.$ac_objext" ;; esac elif test "$ac_cv_header_netinet_ip_fw_h" = yes ; then case "$host_os" in *freebsd5*) case $LIBOBJS in "fw-none.$ac_objext" | \ *" fw-none.$ac_objext" | \ "fw-none.$ac_objext "* | \ *" fw-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-none.$ac_objext" ;; esac ;; *) case $LIBOBJS in "fw-ipfw.$ac_objext" | \ *" fw-ipfw.$ac_objext" | \ "fw-ipfw.$ac_objext "* | \ *" fw-ipfw.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipfw.$ac_objext" ;; esac ;; esac elif test "$ac_cv_header_netinet_ip_fil_h" = yes ; then case $LIBOBJS in "fw-ipf.$ac_objext" | \ *" fw-ipf.$ac_objext" | \ "fw-ipf.$ac_objext "* | \ *" fw-ipf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipf.$ac_objext" ;; esac elif test "$ac_cv_header_linux_ip_fw_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac elif test "$ac_cv_header_linux_ip_fwchains_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac elif test "$ac_cv_header_linux_netfilter_ipv4_ipchains_core_h" = yes ; then case $LIBOBJS in "fw-ipchains.$ac_objext" | \ *" fw-ipchains.$ac_objext" | \ "fw-ipchains.$ac_objext "* | \ *" fw-ipchains.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-ipchains.$ac_objext" ;; esac else case $LIBOBJS in "fw-none.$ac_objext" | \ *" fw-none.$ac_objext" | \ "fw-none.$ac_objext "* | \ *" fw-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fw-none.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "intf-win32.$ac_objext" | \ *" intf-win32.$ac_objext" | \ "intf-win32.$ac_objext "* | \ *" intf-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS intf-win32.$ac_objext" ;; esac else case $LIBOBJS in "intf.$ac_objext" | \ *" intf.$ac_objext" | \ "intf.$ac_objext "* | \ *" intf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS intf.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "ip-win32.$ac_objext" | \ *" ip-win32.$ac_objext" | \ "ip-win32.$ac_objext "* | \ *" ip-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_rawip_cooked" = yes ; then case $LIBOBJS in "ip-cooked.$ac_objext" | \ *" ip-cooked.$ac_objext" | \ "ip-cooked.$ac_objext "* | \ *" ip-cooked.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip-cooked.$ac_objext" ;; esac else case $LIBOBJS in "ip.$ac_objext" | \ *" ip.$ac_objext" | \ "ip.$ac_objext "* | \ *" ip.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS ip.$ac_objext" ;; esac fi if test "$ac_cv_header_Iphlpapi_h" = yes ; then case $LIBOBJS in "route-win32.$ac_objext" | \ *" route-win32.$ac_objext" | \ "route-win32.$ac_objext "* | \ *" route-win32.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-win32.$ac_objext" ;; esac elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then case $LIBOBJS in "route-bsd.$ac_objext" | \ *" route-bsd.$ac_objext" | \ "route-bsd.$ac_objext "* | \ *" route-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-bsd.$ac_objext" ;; esac elif test "$ac_cv_dnet_linux_procfs" = yes ; then case $LIBOBJS in "route-linux.$ac_objext" | \ *" route-linux.$ac_objext" | \ "route-linux.$ac_objext "* | \ *" route-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-linux.$ac_objext" ;; esac elif test "$ac_cv_header_hpsecurity_h" = yes ; then case $LIBOBJS in "route-hpux.$ac_objext" | \ *" route-hpux.$ac_objext" | \ "route-hpux.$ac_objext "* | \ *" route-hpux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-hpux.$ac_objext" ;; esac else case $LIBOBJS in "route-none.$ac_objext" | \ *" route-none.$ac_objext" | \ "route-none.$ac_objext "* | \ *" route-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS route-none.$ac_objext" ;; esac fi if test "$ac_cv_header_linux_if_tun_h" = yes ; then case $LIBOBJS in "tun-linux.$ac_objext" | \ *" tun-linux.$ac_objext" | \ "tun-linux.$ac_objext "* | \ *" tun-linux.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-linux.$ac_objext" ;; esac elif test "$ac_cv_header_net_if_tun_h" = yes ; then if test "$ac_cv_header_stropts_h" = yes ; then case $LIBOBJS in "tun-solaris.$ac_objext" | \ *" tun-solaris.$ac_objext" | \ "tun-solaris.$ac_objext "* | \ *" tun-solaris.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-solaris.$ac_objext" ;; esac else case $LIBOBJS in "tun-bsd.$ac_objext" | \ *" tun-bsd.$ac_objext" | \ "tun-bsd.$ac_objext "* | \ *" tun-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-bsd.$ac_objext" ;; esac fi elif test -c "/dev/tun0" ; then case $LIBOBJS in "tun-bsd.$ac_objext" | \ *" tun-bsd.$ac_objext" | \ "tun-bsd.$ac_objext "* | \ *" tun-bsd.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-bsd.$ac_objext" ;; esac else case $LIBOBJS in "tun-none.$ac_objext" | \ *" tun-none.$ac_objext" | \ "tun-none.$ac_objext "* | \ *" tun-none.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tun-none.$ac_objext" ;; esac fi ac_config_files="$ac_config_files Makefile dnet-config include/Makefile include/dnet/Makefile man/Makefile src/Makefile python/Makefile python/setup.py test/Makefile test/check/Makefile test/dnet/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PYTHON_TRUE}" && test -z "${PYTHON_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${TCL_TRUE}" && test -z "${TCL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"TCL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_CHECK_TRUE}" && test -z "${HAVE_CHECK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_CHECK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_CHECK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "dnet-config" ) CONFIG_FILES="$CONFIG_FILES dnet-config" ;; "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/dnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/dnet/Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "python/Makefile" ) CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; "python/setup.py" ) CONFIG_FILES="$CONFIG_FILES python/setup.py" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/check/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/check/Makefile" ;; "test/dnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/dnet/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@ac_aux_dir@,$ac_aux_dir,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@PYTHON@,$PYTHON,;t t s,@TCLINC@,$TCLINC,;t t s,@TCLLIB@,$TCLLIB,;t t s,@PYTHON_TRUE@,$PYTHON_TRUE,;t t s,@PYTHON_FALSE@,$PYTHON_FALSE,;t t s,@TCL_TRUE@,$TCL_TRUE,;t t s,@TCL_FALSE@,$TCL_FALSE,;t t s,@CHECKINC@,$CHECKINC,;t t s,@CHECKLIB@,$CHECKLIB,;t t s,@HAVE_CHECK_TRUE@,$HAVE_CHECK_TRUE,;t t s,@HAVE_CHECK_FALSE@,$HAVE_CHECK_FALSE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Run the commands associated with the file. case $ac_file in include/config.h ) # update the timestamp echo 'timestamp for include/config.h' >"include/stamp-h1" ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; default ) chmod 755 dnet-config ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi libdnet-1.12/trunk/configure.in0000644000076500007650000002111510554377551017716 0ustar dugsongdugsong00000000000000dnl dnl configure.in dnl dnl Copyright (c) 2000 Dug Song dnl dnl $Id: configure.in 638 2007-01-20 11:39:21Z dugsong $ AC_INIT(include/dnet.h) AC_CONFIG_AUX_DIR(config) AC_SUBST(ac_aux_dir) AM_INIT_AUTOMAKE(libdnet, 1.12) AM_CONFIG_HEADER(include/config.h) dnl XXX - stop the insanity!@#$ AM_MAINTAINER_MODE dnl Check for system type. dnl XXX - we do this to qualify our later feature checks, since some dnl systems claim to support multiple features, but are quite b0rked. AC_CANONICAL_HOST dnl XXX - spoof AC_CYGWIN case "$host_os" in *cygwin*) CYGWIN=yes;; *) CYGWIN=no;; esac dnl Initialize prefix. if test "$prefix" = "NONE"; then prefix="/usr/local" fi dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL dnl Checks for Python. dnl XXX - use AM_PATH_PYTHON after automake upgrade AC_MSG_CHECKING(for Python) AC_ARG_WITH(python, [ --with-python=DIR build Python module (using python in DIR)], [ case "$withval" in yes) AC_MSG_RESULT(yes) PYTHON="python" ;; no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT($withval) for subdir in . bin; do if test -x $withval/$subdir/python; then owd=`pwd` if cd $withval/$subdir; then withval=`pwd`; cd $owd; fi PYTHON="$withval/python" break fi done if test "x$PYTHON" = "x"; then AC_ERROR(python not found in $withval) fi ;; esac ]) AC_SUBST(PYTHON) AC_SUBST(TCLINC) AC_SUBST(TCLLIB) AM_CONDITIONAL(PYTHON, [test "x$PYTHON" != "x"]) AM_CONDITIONAL(TCL, [test "x$TCLINC" != "x"]) dnl XXX - stupid IRIX cpp if test -r /usr/include/sgidefs.h ; then CPPFLAGS="$CPPFLAGS -D__sgi" fi dnl XXX - we need MingW32 under Cygwin for win32 if test "$CYGWIN" = yes ; then if test -d /usr/include/mingw ; then CPPFLAGS="$CPPFLAGS -mno-cygwin" CFLAGS="$CFLAGS -mno-cygwin" AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Define for faster code generation.]) AC_CHECK_LIB(ws2_32, main) AC_CHECK_LIB(iphlpapi, main) AC_DEFINE(snprintf, _snprintf, [Use MingW32's internal snprintf]) else AC_MSG_ERROR([need MingW32 package to build under Cygwin]) fi AC_MSG_CHECKING(for WinPcap developer's pack) AC_ARG_WITH(wpdpack, [ --with-wpdpack=DIR use WinPcap developer's pack in DIR], [ AC_MSG_RESULT($withval) if test -f $withval/include/packet32.h -a -f $withval/lib/packet.lib; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CFLAGS="$CFLAGS -I$withval/include" LIBS="$LIBS -L$withval/lib -lpacket" else AC_MSG_ERROR(packet32.h or packet.lib not found in $withval) fi ], [ for dir in ${prefix} ${HOME}/WPdpack ; do if test -f ${dir}/include/packet32.h -a -f ${dir}/lib/packet.lib; then CFLAGS="$CFLAGS -I${dir}/include" LIBS="$LIBS -L${dir}/lib -lpacket" have_pcap=yes break; fi done if test "$have_pcap" != yes; then AC_MSG_ERROR(WinPcap developer's pack not found) fi AC_MSG_RESULT(yes) ]) fi dnl Checks for libraries. if test "$CYGWIN" != yes ; then AC_LBL_LIBRARY_NET AC_CHECK_LIB(nm, open_mib) fi dnl Checks for Check. AC_MSG_CHECKING(for Check) AC_ARG_WITH(check, [ --with-check=DIR use Check (http://check.sf.net) in DIR], [ case "$withval" in yes|no) AC_MSG_RESULT(no) ;; *) AC_MSG_RESULT($withval) if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/include" CHECKLIB="-L$withval/lib -lcheck" elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then owd=`pwd` if cd $withval; then withval=`pwd`; cd $owd; fi CHECKINC="-I$withval/src" CHECKLIB="-L$withval/src -lcheck" else AC_ERROR(check.h or libcheck.a not found in $withval) fi ;; esac ], [ if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then CHECKINC="-I${prefix}/include" CHECKLIB="-L${prefix}/lib -lcheck" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) AC_SUBST(CHECKINC) AC_SUBST(CHECKLIB) AM_CONDITIONAL(HAVE_CHECK, test "x$CHECKLIB" != "x") dnl Checks for header files. AC_HEADER_STDC if test "$CYGWIN" = yes ; then AC_CHECK_HEADERS(Iphlpapi.h winsock2.h) else AC_CHECK_HEADERS(fcntl.h unistd.h) AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h \ sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h \ sys/sysctl.h sys/time.h) AC_CHECK_HEADERS(net/bpf.h net/if.h net/if_var.h \ net/if_arp.h net/if_dl.h net/pfilt.h \ net/pfvar.h net/radix.h net/raw.h net/route.h netinet/in_var.h \ net/if_tun.h linux/if_tun.h netinet/ip_fw.h linux/ip_fw.h \ linux/ip_fwchains.h linux/netfilter_ipv4/ipchains_core.h) AC_CHECK_HEADERS(ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h \ netinet/ip_compat.h ip_fil.h netinet/ip_fil.h) AC_CHECK_HEADERS(hpsecurity.h stropts.h) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_DNET_SOCKADDR_IN6 if test "$ac_cv_header_sys_socket_h" = yes ; then AC_DNET_SOCKADDR_SA_LEN fi if test "$ac_cv_header_net_if_arp_h" = yes ; then AC_DNET_ARPREQ_ARP_DEV fi if test "$ac_cv_header_net_route_h" = yes ; then AC_DNET_ROUTE_RT_MSGHDR fi AC_PROG_GCC_TRADITIONAL if test "$GCC" = yes ; then CFLAGS="$CFLAGS -Wall" fi dnl Checks for library functions. AC_FUNC_MEMCMP AC_REPLACE_FUNCS(err strlcat strlcpy strsep) dnl Checks for other system-specific jonks. if test "$CYGWIN" != yes ; then AC_DNET_BSD_BPF AC_DNET_LINUX_PROCFS AC_DNET_LINUX_PF_PACKET AC_DNET_STREAMS_MIB2 AC_DNET_STREAMS_ROUTE AC_DNET_IOCTL_ARP AC_DNET_RAWIP_HOST_OFFLEN AC_DNET_RAWIP_COOKED fi dnl Check for arp interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([arp-win32]) elif test "$ac_cv_dnet_ioctl_arp" = yes ; then AC_LIBOBJ([arp-ioctl]) elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then AC_LIBOBJ([arp-bsd]) else AC_LIBOBJ([arp-none]) fi dnl Check for Ethernet interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([eth-win32]) elif test "$ac_cv_header_net_pfilt_h" = yes ; then AC_LIBOBJ([eth-pfilt]) elif test "$ac_cv_dnet_bsd_bpf" = yes ; then AC_LIBOBJ([eth-bsd]) elif test "$ac_cv_dnet_linux_pf_packet" = yes ; then AC_LIBOBJ([eth-linux]) elif test "$ac_cv_header_net_raw_h" = yes ; then AC_LIBOBJ([eth-snoop]) elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then AC_LIBOBJ([eth-ndd]) elif test "$ac_cv_header_sys_dlpi_h" = yes || \ test "$ac_cv_header_sys_dlpihdr_h" = yes ; then AC_LIBOBJ([eth-dlpi]) else AC_LIBOBJ([eth-none]) fi dnl Check for firewall interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([fw-pktfilter]) elif test "$ac_cv_header_net_pfvar_h" = yes ; then AC_LIBOBJ([fw-pf]) elif test "$ac_cv_header_netinet_ip_fw_h" = yes ; then dnl XXX - ipfw2 support later... case "$host_os" in *freebsd5*) AC_LIBOBJ([fw-none]) ;; *) AC_LIBOBJ([fw-ipfw]) ;; esac elif test "$ac_cv_header_netinet_ip_fil_h" = yes ; then AC_LIBOBJ([fw-ipf]) elif test "$ac_cv_header_linux_ip_fw_h" = yes ; then AC_LIBOBJ([fw-ipchains]) elif test "$ac_cv_header_linux_ip_fwchains_h" = yes ; then AC_LIBOBJ([fw-ipchains]) elif test "$ac_cv_header_linux_netfilter_ipv4_ipchains_core_h" = yes ; then AC_LIBOBJ([fw-ipchains]) else AC_LIBOBJ([fw-none]) fi dnl Check for network interface interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([intf-win32]) else AC_LIBOBJ([intf]) fi dnl Check for raw IP interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([ip-win32]) elif test "$ac_cv_dnet_rawip_cooked" = yes ; then AC_LIBOBJ([ip-cooked]) else AC_LIBOBJ([ip]) fi dnl Check for routing interface. if test "$ac_cv_header_Iphlpapi_h" = yes ; then AC_LIBOBJ([route-win32]) elif test "$ac_cv_dnet_route_h_has_rt_msghdr" = yes ; then AC_LIBOBJ([route-bsd]) elif test "$ac_cv_dnet_linux_procfs" = yes ; then AC_LIBOBJ([route-linux]) elif test "$ac_cv_header_hpsecurity_h" = yes ; then AC_LIBOBJ([route-hpux]) else AC_LIBOBJ([route-none]) fi dnl Check for tun interface. if test "$ac_cv_header_linux_if_tun_h" = yes ; then AC_LIBOBJ([tun-linux]) elif test "$ac_cv_header_net_if_tun_h" = yes ; then if test "$ac_cv_header_stropts_h" = yes ; then AC_LIBOBJ([tun-solaris]) else AC_LIBOBJ([tun-bsd]) fi elif test -c "/dev/tun0" ; then AC_LIBOBJ([tun-bsd]) else AC_LIBOBJ([tun-none]) fi AC_OUTPUT([Makefile dnet-config include/Makefile include/dnet/Makefile man/Makefile src/Makefile python/Makefile python/setup.py test/Makefile test/check/Makefile test/dnet/Makefile], [chmod 755 dnet-config]) libdnet-1.12/trunk/dnet-config.in0000644000076500007650000000132707363700734020132 0ustar dugsongdugsong00000000000000#!/bin/sh # # $Id: dnet-config.in 91 2001-10-19 01:29:00Z dugsong $ prefix=@prefix@ exec_prefix=@prefix@ usage() { cat <&2 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --version) echo @VERSION@ ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_cflags" = "yes"; then echo -I@includedir@ fi if test "$echo_libs" = "yes"; then echo -L@libdir@ -ldnet @LIBS@ fi libdnet-1.12/trunk/include/0000755000076500007650000000000010554406430017015 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/include/config.h.in0000644000076500007650000001714110363627052021047 0ustar dugsongdugsong00000000000000/* include/config.h.in. Generated from configure.in by autoheader. */ /* Define if arpreq struct has arp_dev. */ #undef HAVE_ARPREQ_ARP_DEV /* Define if you have the Berkeley Packet Filter. */ #undef HAVE_BSD_BPF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `err' function. */ #undef HAVE_ERR /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_HPSECURITY_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have arp(7) ioctls. */ #undef HAVE_IOCTL_ARP /* Define to 1 if you have the header file. */ #undef HAVE_IPHLPAPI_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_FIL_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_IP_FIL_H /* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ #undef HAVE_LIBIPHLPAPI /* Define to 1 if you have the `nm' library (-lnm). */ #undef HAVE_LIBNM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `str' library (-lstr). */ #undef HAVE_LIBSTR /* 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_LINUX_IF_TUN_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IP_FWCHAINS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IP_FW_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H /* Define if you have Linux PF_PACKET sockets. */ #undef HAVE_LINUX_PF_PACKET /* Define if you have the Linux /proc filesystem. */ #undef HAVE_LINUX_PROCFS /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_FIL_COMPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IP_FIL_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_NET_BPF_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_ARP_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_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_TUN_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFILT_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFVAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_RADIX_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_RAW_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_ROUTE_H /* Define if you have cooked raw IP sockets. */ #undef HAVE_RAWIP_COOKED /* Define if raw IP sockets require host byte ordering for ip_off, ip_len. */ #undef HAVE_RAWIP_HOST_OFFLEN /* Define if has rt_msghdr struct. */ #undef HAVE_ROUTE_RT_MSGHDR /* Define if has sockaddr_in6 struct. */ #undef HAVE_SOCKADDR_IN6 /* Define if sockaddr struct has sa_len. */ #undef HAVE_SOCKADDR_SA_LEN /* 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 if you have SNMP MIB2 STREAMS. */ #undef HAVE_STREAMS_MIB2 /* Define if you have route(7) STREAMS. */ #undef HAVE_STREAMS_ROUTE /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BUFMOD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPIHDR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPI_EXT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DLPI_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_MIB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_NDD_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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 the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WINSOCK2_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define for faster code generation. */ #undef WIN32_LEAN_AND_MEAN /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* Use MingW32's internal snprintf */ #undef snprintf #include #ifdef HAVE_WINSOCK2_H # include # include #endif #ifdef __svr4__ # define BSD_COMP 1 #endif #if defined(__osf__) && !defined(_SOCKADDR_LEN) # define _SOCKADDR_LEN 1 #endif #ifndef HAVE_INET_PTON int inet_pton(int, const char *, void *); #endif #ifndef HAVE_STRLCAT int strlcat(char *, const char *, int); #endif #ifndef HAVE_STRLCPY int strlcpy(char *, const char *, int); #endif #ifndef HAVE_STRSEP char *strsep(char **, const char *); #endif libdnet-1.12/trunk/include/dnet/0000755000076500007650000000000010554406426017754 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/include/dnet/addr.h0000644000076500007650000000333107627304667021052 0ustar dugsongdugsong00000000000000/* * addr.h * * Network address operations. * * Copyright (c) 2000 Dug Song * * $Id: addr.h 404 2003-02-27 03:44:55Z dugsong $ */ #ifndef DNET_ADDR_H #define DNET_ADDR_H #define ADDR_TYPE_NONE 0 /* No address set */ #define ADDR_TYPE_ETH 1 /* Ethernet */ #define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ #define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ struct addr { uint16_t addr_type; uint16_t addr_bits; union { eth_addr_t __eth; ip_addr_t __ip; ip6_addr_t __ip6; uint8_t __data8[16]; uint16_t __data16[8]; uint32_t __data32[4]; } __addr_u; }; #define addr_eth __addr_u.__eth #define addr_ip __addr_u.__ip #define addr_ip6 __addr_u.__ip6 #define addr_data8 __addr_u.__data8 #define addr_data16 __addr_u.__data16 #define addr_data32 __addr_u.__data32 #define addr_pack(addr, type, bits, data, len) do { \ (addr)->addr_type = type; \ (addr)->addr_bits = bits; \ memmove((addr)->addr_data8, (char *)data, len); \ } while (0) __BEGIN_DECLS int addr_cmp(const struct addr *a, const struct addr *b); int addr_bcast(const struct addr *a, struct addr *b); int addr_net(const struct addr *a, struct addr *b); char *addr_ntop(const struct addr *src, char *dst, size_t size); int addr_pton(const char *src, struct addr *dst); char *addr_ntoa(const struct addr *a); #define addr_aton addr_pton int addr_ntos(const struct addr *a, struct sockaddr *sa); int addr_ston(const struct sockaddr *sa, struct addr *a); int addr_btos(uint16_t bits, struct sockaddr *sa); int addr_stob(const struct sockaddr *sa, uint16_t *bits); int addr_btom(uint16_t bits, void *mask, size_t size); int addr_mtob(const void *mask, size_t size, uint16_t *bits); __END_DECLS #endif /* DNET_ADDR_H */ libdnet-1.12/trunk/include/dnet/arp.h0000644000076500007650000000532707635133306020716 0ustar dugsongdugsong00000000000000/* * arp.h * * Address Resolution Protocol. * RFC 826 * * Copyright (c) 2000 Dug Song * * $Id: arp.h 416 2003-03-16 17:39:18Z dugsong $ */ #ifndef DNET_ARP_H #define DNET_ARP_H #define ARP_HDR_LEN 8 /* base ARP header length */ #define ARP_ETHIP_LEN 20 /* base ARP message length */ #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * ARP header */ struct arp_hdr { uint16_t ar_hrd; /* format of hardware address */ uint16_t ar_pro; /* format of protocol address */ uint8_t ar_hln; /* length of hardware address (ETH_ADDR_LEN) */ uint8_t ar_pln; /* length of protocol address (IP_ADDR_LEN) */ uint16_t ar_op; /* operation */ }; /* * Hardware address format */ #define ARP_HRD_ETH 0x0001 /* ethernet hardware */ #define ARP_HRD_IEEE802 0x0006 /* IEEE 802 hardware */ /* * Protocol address format */ #define ARP_PRO_IP 0x0800 /* IP protocol */ /* * ARP operation */ #define ARP_OP_REQUEST 1 /* request to resolve ha given pa */ #define ARP_OP_REPLY 2 /* response giving hardware address */ #define ARP_OP_REVREQUEST 3 /* request to resolve pa given ha */ #define ARP_OP_REVREPLY 4 /* response giving protocol address */ /* * Ethernet/IP ARP message */ struct arp_ethip { uint8_t ar_sha[ETH_ADDR_LEN]; /* sender hardware address */ uint8_t ar_spa[IP_ADDR_LEN]; /* sender protocol address */ uint8_t ar_tha[ETH_ADDR_LEN]; /* target hardware address */ uint8_t ar_tpa[IP_ADDR_LEN]; /* target protocol address */ }; /* * ARP cache entry */ struct arp_entry { struct addr arp_pa; /* protocol address */ struct addr arp_ha; /* hardware address */ }; #ifndef __GNUC__ # pragma pack() #endif #define arp_pack_hdr_ethip(hdr, op, sha, spa, tha, tpa) do { \ struct arp_hdr *pack_arp_p = (struct arp_hdr *)(hdr); \ struct arp_ethip *pack_ethip_p = (struct arp_ethip *) \ ((uint8_t *)(hdr) + ARP_HDR_LEN); \ pack_arp_p->ar_hrd = htons(ARP_HRD_ETH); \ pack_arp_p->ar_pro = htons(ARP_PRO_IP); \ pack_arp_p->ar_hln = ETH_ADDR_LEN; \ pack_arp_p->ar_pln = IP_ADDR_LEN; \ pack_arp_p->ar_op = htons(op); \ memmove(pack_ethip_p->ar_sha, &(sha), ETH_ADDR_LEN); \ memmove(pack_ethip_p->ar_spa, &(spa), IP_ADDR_LEN); \ memmove(pack_ethip_p->ar_tha, &(tha), ETH_ADDR_LEN); \ memmove(pack_ethip_p->ar_tpa, &(tpa), IP_ADDR_LEN); \ } while (0) typedef struct arp_handle arp_t; typedef int (*arp_handler)(const struct arp_entry *entry, void *arg); __BEGIN_DECLS arp_t *arp_open(void); int arp_add(arp_t *arp, const struct arp_entry *entry); int arp_delete(arp_t *arp, const struct arp_entry *entry); int arp_get(arp_t *arp, struct arp_entry *entry); int arp_loop(arp_t *arp, arp_handler callback, void *arg); arp_t *arp_close(arp_t *arp); __END_DECLS #endif /* DNET_ARP_H */ libdnet-1.12/trunk/include/dnet/blob.h0000644000076500007650000000266207453212304021043 0ustar dugsongdugsong00000000000000/* * blob.h * * Binary blob handling. * * Copyright (c) 2002 Dug Song * * $Id: blob.h 334 2002-04-05 03:06:44Z dugsong $ */ #ifndef DNET_BLOB_H #define DNET_BLOB_H typedef struct blob { u_char *base; /* start of data */ int off; /* offset into data */ int end; /* end of data */ int size; /* size of allocation */ } blob_t; __BEGIN_DECLS blob_t *blob_new(void); int blob_read(blob_t *b, void *buf, int len); int blob_write(blob_t *b, const void *buf, int len); int blob_seek(blob_t *b, int off, int whence); #define blob_skip(b, l) blob_seek(b, l, SEEK_CUR) #define blob_rewind(b) blob_seek(b, 0, SEEK_SET) #define blob_offset(b) ((b)->off) #define blob_left(b) ((b)->end - (b)->off) int blob_index(blob_t *b, const void *buf, int len); int blob_rindex(blob_t *b, const void *buf, int len); int blob_pack(blob_t *b, const char *fmt, ...); int blob_unpack(blob_t *b, const char *fmt, ...); int blob_insert(blob_t *b, const void *buf, int len); int blob_delete(blob_t *b, void *buf, int len); int blob_print(blob_t *b, char *style, int len); blob_t *blob_free(blob_t *b); int blob_register_alloc(size_t size, void *(*bmalloc)(size_t), void (*bfree)(void *), void *(*brealloc)(void *, size_t)); #ifdef va_start typedef int (*blob_fmt_cb)(int pack, int len, blob_t *b, va_list *arg); int blob_register_pack(char c, blob_fmt_cb fmt_cb); #endif __END_DECLS #endif /* DNET_BLOB_H */ libdnet-1.12/trunk/include/dnet/eth.h0000644000076500007650000000446110175535200020702 0ustar dugsongdugsong00000000000000/* * eth.h * * Ethernet. * * Copyright (c) 2000 Dug Song * * $Id: eth.h 547 2005-01-25 21:30:40Z dugsong $ */ #ifndef DNET_ETH_H #define DNET_ETH_H #define ETH_ADDR_LEN 6 #define ETH_ADDR_BITS 48 #define ETH_TYPE_LEN 2 #define ETH_CRC_LEN 4 #define ETH_HDR_LEN 14 #define ETH_LEN_MIN 64 /* minimum frame length with CRC */ #define ETH_LEN_MAX 1518 /* maximum frame length with CRC */ #define ETH_MTU (ETH_LEN_MAX - ETH_HDR_LEN - ETH_CRC_LEN) #define ETH_MIN (ETH_LEN_MIN - ETH_HDR_LEN - ETH_CRC_LEN) typedef struct eth_addr { uint8_t data[ETH_ADDR_LEN]; } eth_addr_t; struct eth_hdr { eth_addr_t eth_dst; /* destination address */ eth_addr_t eth_src; /* source address */ uint16_t eth_type; /* payload type */ }; /* * Ethernet payload types - http://standards.ieee.org/regauth/ethertype */ #define ETH_TYPE_PUP 0x0200 /* PUP protocol */ #define ETH_TYPE_IP 0x0800 /* IP protocol */ #define ETH_TYPE_ARP 0x0806 /* address resolution protocol */ #define ETH_TYPE_REVARP 0x8035 /* reverse addr resolution protocol */ #define ETH_TYPE_8021Q 0x8100 /* IEEE 802.1Q VLAN tagging */ #define ETH_TYPE_IPV6 0x86DD /* IPv6 protocol */ #define ETH_TYPE_MPLS 0x8847 /* MPLS */ #define ETH_TYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETH_TYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */ #define ETH_TYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETH_TYPE_LOOPBACK 0x9000 /* used to test interfaces */ #define ETH_IS_MULTICAST(ea) (*(ea) & 0x01) /* is address mcast/bcast? */ #define ETH_ADDR_BROADCAST "\xff\xff\xff\xff\xff\xff" #define eth_pack_hdr(h, dst, src, type) do { \ struct eth_hdr *eth_pack_p = (struct eth_hdr *)(h); \ memmove(ð_pack_p->eth_dst, &(dst), ETH_ADDR_LEN); \ memmove(ð_pack_p->eth_src, &(src), ETH_ADDR_LEN); \ eth_pack_p->eth_type = htons(type); \ } while (0) typedef struct eth_handle eth_t; __BEGIN_DECLS eth_t *eth_open(const char *device); int eth_get(eth_t *e, eth_addr_t *ea); int eth_set(eth_t *e, const eth_addr_t *ea); ssize_t eth_send(eth_t *e, const void *buf, size_t len); eth_t *eth_close(eth_t *e); char *eth_ntop(const eth_addr_t *eth, char *dst, size_t len); int eth_pton(const char *src, eth_addr_t *dst); char *eth_ntoa(const eth_addr_t *eth); #define eth_aton eth_pton __END_DECLS #endif /* DNET_ETH_H */ libdnet-1.12/trunk/include/dnet/fw.h0000644000076500007650000000273607576526534020566 0ustar dugsongdugsong00000000000000/* * fw.h * * Network firewalling operations. * * Copyright (c) 2001 Dug Song * * $Id: fw.h 394 2002-12-14 04:02:36Z dugsong $ */ #ifndef DNET_FW_H #define DNET_FW_H struct fw_rule { char fw_device[INTF_NAME_LEN]; /* interface name */ uint8_t fw_op; /* operation */ uint8_t fw_dir; /* direction */ uint8_t fw_proto; /* IP protocol */ struct addr fw_src; /* src address / net */ struct addr fw_dst; /* dst address / net */ uint16_t fw_sport[2]; /* range / ICMP type */ uint16_t fw_dport[2]; /* range / ICMP code */ }; #define FW_OP_ALLOW 1 #define FW_OP_BLOCK 2 #define FW_DIR_IN 1 #define FW_DIR_OUT 2 #define fw_pack_rule(rule, dev, op, dir, p, s, d, sp1, sp2, dp1, dp2) \ do { \ strlcpy((rule)->fw_device, dev, sizeof((rule)->fw_device)); \ (rule)->fw_op = op; (rule)->fw_dir = dir; \ (rule)->fw_proto = p; \ memmove(&(rule)->fw_src, &(s), sizeof((rule)->fw_src)); \ memmove(&(rule)->fw_dst, &(d), sizeof((rule)->fw_dst)); \ (rule)->fw_sport[0] = sp1; (rule)->fw_sport[1] = sp2; \ (rule)->fw_dport[0] = dp1; (rule)->fw_dport[1] = dp2; \ } while (0) typedef struct fw_handle fw_t; typedef int (*fw_handler)(const struct fw_rule *rule, void *arg); __BEGIN_DECLS fw_t *fw_open(void); int fw_add(fw_t *f, const struct fw_rule *rule); int fw_delete(fw_t *f, const struct fw_rule *rule); int fw_loop(fw_t *f, fw_handler callback, void *arg); fw_t *fw_close(fw_t *f); __END_DECLS #endif /* DNET_FW_H */ libdnet-1.12/trunk/include/dnet/icmp.h0000644000076500007650000002230407635133306021056 0ustar dugsongdugsong00000000000000/* * icmp.h * * Internet Control Message Protocol. * RFC 792, 950, 1256, 1393, 1475, 2002, 2521 * * Copyright (c) 2000 Dug Song * * $Id: icmp.h 416 2003-03-16 17:39:18Z dugsong $ */ #ifndef DNET_ICMP_H #define DNET_ICMP_H #define ICMP_HDR_LEN 4 /* base ICMP header length */ #define ICMP_LEN_MIN 8 /* minimum ICMP message size, with header */ #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * ICMP header */ struct icmp_hdr { uint8_t icmp_type; /* type of message, see below */ uint8_t icmp_code; /* type sub code */ uint16_t icmp_cksum; /* ones complement cksum of struct */ }; /* * Types (icmp_type) and codes (icmp_code) - * http://www.iana.org/assignments/icmp-parameters */ #define ICMP_CODE_NONE 0 /* for types without codes */ #define ICMP_ECHOREPLY 0 /* echo reply */ #define ICMP_UNREACH 3 /* dest unreachable, codes: */ #define ICMP_UNREACH_NET 0 /* bad net */ #define ICMP_UNREACH_HOST 1 /* bad host */ #define ICMP_UNREACH_PROTO 2 /* bad protocol */ #define ICMP_UNREACH_PORT 3 /* bad port */ #define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ #define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ #define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ #define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ #define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ #define ICMP_UNREACH_NET_PROHIB 9 /* for crypto devs */ #define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ #define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ #define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ #define ICMP_UNREACH_FILTER_PROHIB 13 /* prohibited access */ #define ICMP_UNREACH_HOST_PRECEDENCE 14 /* precedence error */ #define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* precedence cutoff */ #define ICMP_SRCQUENCH 4 /* packet lost, slow down */ #define ICMP_REDIRECT 5 /* shorter route, codes: */ #define ICMP_REDIRECT_NET 0 /* for network */ #define ICMP_REDIRECT_HOST 1 /* for host */ #define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ #define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ #define ICMP_ALTHOSTADDR 6 /* alternate host address */ #define ICMP_ECHO 8 /* echo service */ #define ICMP_RTRADVERT 9 /* router advertise, codes: */ #define ICMP_RTRADVERT_NORMAL 0 /* normal */ #define ICMP_RTRADVERT_NOROUTE_COMMON 16 /* selective routing */ #define ICMP_RTRSOLICIT 10 /* router solicitation */ #define ICMP_TIMEXCEED 11 /* time exceeded, code: */ #define ICMP_TIMEXCEED_INTRANS 0 /* ttl==0 in transit */ #define ICMP_TIMEXCEED_REASS 1 /* ttl==0 in reass */ #define ICMP_PARAMPROB 12 /* ip header bad */ #define ICMP_PARAMPROB_ERRATPTR 0 /* req. opt. absent */ #define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ #define ICMP_PARAMPROB_LENGTH 2 /* bad length */ #define ICMP_TSTAMP 13 /* timestamp request */ #define ICMP_TSTAMPREPLY 14 /* timestamp reply */ #define ICMP_INFO 15 /* information request */ #define ICMP_INFOREPLY 16 /* information reply */ #define ICMP_MASK 17 /* address mask request */ #define ICMP_MASKREPLY 18 /* address mask reply */ #define ICMP_TRACEROUTE 30 /* traceroute */ #define ICMP_DATACONVERR 31 /* data conversion error */ #define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ #define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ #define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ #define ICMP_MOBILE_REG 35 /* mobile registration req */ #define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ #define ICMP_DNS 37 /* domain name request */ #define ICMP_DNSREPLY 38 /* domain name reply */ #define ICMP_SKIP 39 /* SKIP */ #define ICMP_PHOTURIS 40 /* Photuris */ #define ICMP_PHOTURIS_UNKNOWN_INDEX 0 /* unknown sec index */ #define ICMP_PHOTURIS_AUTH_FAILED 1 /* auth failed */ #define ICMP_PHOTURIS_DECOMPRESS_FAILED 2 /* decompress failed */ #define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ #define ICMP_PHOTURIS_NEED_AUTHN 4 /* no authentication */ #define ICMP_PHOTURIS_NEED_AUTHZ 5 /* no authorization */ #define ICMP_TYPE_MAX 40 #define ICMP_INFOTYPE(type) \ ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ (type) == ICMP_RTRADVERT || (type) == ICMP_RTRSOLICIT || \ (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ (type) == ICMP_INFO || (type) == ICMP_INFOREPLY || \ (type) == ICMP_MASK || (type) == ICMP_MASKREPLY) /* * Echo message data */ struct icmp_msg_echo { uint16_t icmp_id; uint16_t icmp_seq; uint8_t icmp_data __flexarr; /* optional data */ }; /* * Fragmentation-needed (unreachable) message data */ struct icmp_msg_needfrag { uint16_t icmp_void; /* must be zero */ uint16_t icmp_mtu; /* MTU of next-hop network */ uint8_t icmp_ip __flexarr; /* IP hdr + 8 bytes of pkt */ }; /* * Unreachable, source quench, redirect, time exceeded, * parameter problem message data */ struct icmp_msg_quote { uint32_t icmp_void; /* must be zero */ #define icmp_gwaddr icmp_void /* router IP address to use */ #define icmp_pptr icmp_void /* ptr to bad octet field */ uint8_t icmp_ip __flexarr; /* IP hdr + 8 bytes of pkt */ }; /* * Router advertisement message data, RFC 1256 */ struct icmp_msg_rtradvert { uint8_t icmp_num_addrs; /* # of address / pref pairs */ uint8_t icmp_wpa; /* words / address == 2 */ uint16_t icmp_lifetime; /* route lifetime in seconds */ struct icmp_msg_rtr_data { uint32_t icmp_void; #define icmp_gwaddr icmp_void /* router IP address */ uint32_t icmp_pref; /* router preference (usu 0) */ } icmp_rtr __flexarr; /* variable # of routers */ }; #define ICMP_RTR_PREF_NODEFAULT 0x80000000 /* do not use as default gw */ /* * Timestamp message data */ struct icmp_msg_tstamp { uint32_t icmp_id; /* identifier */ uint32_t icmp_seq; /* sequence number */ uint32_t icmp_ts_orig; /* originate timestamp */ uint32_t icmp_ts_rx; /* receive timestamp */ uint32_t icmp_ts_tx; /* transmit timestamp */ }; /* * Address mask message data, RFC 950 */ struct icmp_msg_mask { uint32_t icmp_id; /* identifier */ uint32_t icmp_seq; /* sequence number */ uint32_t icmp_mask; /* address mask */ }; /* * Traceroute message data, RFC 1393, RFC 1812 */ struct icmp_msg_traceroute { uint16_t icmp_id; /* identifier */ uint16_t icmp_void; /* unused */ uint16_t icmp_ohc; /* outbound hop count */ uint16_t icmp_rhc; /* return hop count */ uint32_t icmp_speed; /* link speed, bytes/sec */ uint32_t icmp_mtu; /* MTU in bytes */ }; /* * Domain name reply message data, RFC 1788 */ struct icmp_msg_dnsreply { uint16_t icmp_id; /* identifier */ uint16_t icmp_seq; /* sequence number */ uint32_t icmp_ttl; /* time-to-live */ uint8_t icmp_names __flexarr; /* variable number of names */ }; /* * Generic identifier, sequence number data */ struct icmp_msg_idseq { uint16_t icmp_id; uint16_t icmp_seq; }; /* * ICMP message union */ union icmp_msg { struct icmp_msg_echo echo; /* ICMP_ECHO{REPLY} */ struct icmp_msg_quote unreach; /* ICMP_UNREACH */ struct icmp_msg_needfrag needfrag; /* ICMP_UNREACH_NEEDFRAG */ struct icmp_msg_quote srcquench; /* ICMP_SRCQUENCH */ struct icmp_msg_quote redirect; /* ICMP_REDIRECT (set to 0) */ uint32_t rtrsolicit; /* ICMP_RTRSOLICIT */ struct icmp_msg_rtradvert rtradvert; /* ICMP_RTRADVERT */ struct icmp_msg_quote timexceed; /* ICMP_TIMEXCEED */ struct icmp_msg_quote paramprob; /* ICMP_PARAMPROB */ struct icmp_msg_tstamp tstamp; /* ICMP_TSTAMP{REPLY} */ struct icmp_msg_idseq info; /* ICMP_INFO{REPLY} */ struct icmp_msg_mask mask; /* ICMP_MASK{REPLY} */ struct icmp_msg_traceroute traceroute; /* ICMP_TRACEROUTE */ struct icmp_msg_idseq dns; /* ICMP_DNS */ struct icmp_msg_dnsreply dnsreply; /* ICMP_DNSREPLY */ }; #ifndef __GNUC__ # pragma pack() #endif #define icmp_pack_hdr(hdr, type, code) do { \ struct icmp_hdr *icmp_pack_p = (struct icmp_hdr *)(hdr); \ icmp_pack_p->icmp_type = type; icmp_pack_p->icmp_code = code; \ } while (0) #define icmp_pack_hdr_echo(hdr, type, code, id, seq, data, len) do { \ struct icmp_msg_echo *echo_pack_p = (struct icmp_msg_echo *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ echo_pack_p->icmp_id = htons(id); \ echo_pack_p->icmp_seq = htons(seq); \ memmove(echo_pack_p->icmp_data, data, len); \ } while (0) #define icmp_pack_hdr_quote(hdr, type, code, word, pkt, len) do { \ struct icmp_msg_quote *quote_pack_p = (struct icmp_msg_quote *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ quote_pack_p->icmp_void = htonl(word); \ memmove(quote_pack_p->icmp_ip, pkt, len); \ } while (0) #define icmp_pack_hdr_mask(hdr, type, code, id, seq, mask) do { \ struct icmp_msg_mask *mask_pack_p = (struct icmp_msg_mask *) \ ((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ mask_pack_p->icmp_id = htons(id); \ mask_pack_p->icmp_seq = htons(seq); \ mask_pack_p->icmp_mask = htonl(mask); \ } while (0) #define icmp_pack_hdr_needfrag(hdr, type, code, mtu, pkt, len) do { \ struct icmp_msg_needfrag *frag_pack_p = \ (struct icmp_msg_needfrag *)((uint8_t *)(hdr) + ICMP_HDR_LEN); \ icmp_pack_hdr(hdr, type, code); \ frag_pack_p->icmp_void = 0; \ frag_pack_p->icmp_mtu = htons(mtu); \ memmove(frag_pack_p->icmp_ip, pkt, len); \ } while (0) #endif /* DNET_ICMP_H */ libdnet-1.12/trunk/include/dnet/intf.h0000644000076500007650000000424410000720425021051 0ustar dugsongdugsong00000000000000/* * intf.c * * Network interface operations. * * Copyright (c) 2000 Dug Song * * $Id: intf.h 478 2004-01-13 07:41:09Z dugsong $ */ #ifndef DNET_INTF_H #define DNET_INTF_H /* * Interface entry */ #define INTF_NAME_LEN 16 struct intf_entry { u_int intf_len; /* length of entry */ char intf_name[INTF_NAME_LEN]; /* interface name */ u_short intf_type; /* interface type (r/o) */ u_short intf_flags; /* interface flags */ u_int intf_mtu; /* interface MTU */ struct addr intf_addr; /* interface address */ struct addr intf_dst_addr; /* point-to-point dst */ struct addr intf_link_addr; /* link-layer address */ u_int intf_alias_num; /* number of aliases */ struct addr intf_alias_addrs __flexarr; /* array of aliases */ }; /* * MIB-II interface types - http://www.iana.org/assignments/ianaiftype-mib */ #define INTF_TYPE_OTHER 1 /* other */ #define INTF_TYPE_ETH 6 /* Ethernet */ #define INTF_TYPE_TOKENRING 9 /* Token Ring */ #define INTF_TYPE_FDDI 15 /* FDDI */ #define INTF_TYPE_PPP 23 /* Point-to-Point Protocol */ #define INTF_TYPE_LOOPBACK 24 /* software loopback */ #define INTF_TYPE_SLIP 28 /* Serial Line Interface Protocol */ #define INTF_TYPE_TUN 53 /* proprietary virtual/internal */ /* * Interface flags */ #define INTF_FLAG_UP 0x01 /* enable interface */ #define INTF_FLAG_LOOPBACK 0x02 /* is a loopback net (r/o) */ #define INTF_FLAG_POINTOPOINT 0x04 /* point-to-point link (r/o) */ #define INTF_FLAG_NOARP 0x08 /* disable ARP */ #define INTF_FLAG_BROADCAST 0x10 /* supports broadcast (r/o) */ #define INTF_FLAG_MULTICAST 0x20 /* supports multicast (r/o) */ typedef struct intf_handle intf_t; typedef int (*intf_handler)(const struct intf_entry *entry, void *arg); __BEGIN_DECLS intf_t *intf_open(void); int intf_get(intf_t *i, struct intf_entry *entry); int intf_get_src(intf_t *i, struct intf_entry *entry, struct addr *src); int intf_get_dst(intf_t *i, struct intf_entry *entry, struct addr *dst); int intf_set(intf_t *i, const struct intf_entry *entry); int intf_loop(intf_t *i, intf_handler callback, void *arg); intf_t *intf_close(intf_t *i); __END_DECLS #endif /* DNET_INTF_H */ libdnet-1.12/trunk/include/dnet/ip.h0000644000076500007650000004045710204741405020536 0ustar dugsongdugsong00000000000000/* * ip.h * * Internet Protocol (RFC 791). * * Copyright (c) 2000 Dug Song * * $Id: ip.h 594 2005-02-16 22:02:45Z dugsong $ */ #ifndef DNET_IP_H #define DNET_IP_H #define IP_ADDR_LEN 4 /* IP address length */ #define IP_ADDR_BITS 32 /* IP address bits */ #define IP_HDR_LEN 20 /* base IP header length */ #define IP_OPT_LEN 2 /* base IP option length */ #define IP_OPT_LEN_MAX 40 #define IP_HDR_LEN_MAX (IP_HDR_LEN + IP_OPT_LEN_MAX) #define IP_LEN_MAX 65535 #define IP_LEN_MIN IP_HDR_LEN typedef uint32_t ip_addr_t; #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * IP header, without options */ struct ip_hdr { #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t ip_v:4, /* version */ ip_hl:4; /* header length (incl any options) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t ip_hl:4, ip_v:4; #else # error "need to include " #endif uint8_t ip_tos; /* type of service */ uint16_t ip_len; /* total length (incl header) */ uint16_t ip_id; /* identification */ uint16_t ip_off; /* fragment offset and flags */ uint8_t ip_ttl; /* time to live */ uint8_t ip_p; /* protocol */ uint16_t ip_sum; /* checksum */ ip_addr_t ip_src; /* source address */ ip_addr_t ip_dst; /* destination address */ }; /* * Type of service (ip_tos), RFC 1349 ("obsoleted by RFC 2474") */ #define IP_TOS_DEFAULT 0x00 /* default */ #define IP_TOS_LOWDELAY 0x10 /* low delay */ #define IP_TOS_THROUGHPUT 0x08 /* high throughput */ #define IP_TOS_RELIABILITY 0x04 /* high reliability */ #define IP_TOS_LOWCOST 0x02 /* low monetary cost - XXX */ #define IP_TOS_ECT 0x02 /* ECN-capable transport */ #define IP_TOS_CE 0x01 /* congestion experienced */ /* * IP precedence (high 3 bits of ip_tos), hopefully unused */ #define IP_TOS_PREC_ROUTINE 0x00 #define IP_TOS_PREC_PRIORITY 0x20 #define IP_TOS_PREC_IMMEDIATE 0x40 #define IP_TOS_PREC_FLASH 0x60 #define IP_TOS_PREC_FLASHOVERRIDE 0x80 #define IP_TOS_PREC_CRITIC_ECP 0xa0 #define IP_TOS_PREC_INTERNETCONTROL 0xc0 #define IP_TOS_PREC_NETCONTROL 0xe0 /* * Fragmentation flags (ip_off) */ #define IP_RF 0x8000 /* reserved */ #define IP_DF 0x4000 /* don't fragment */ #define IP_MF 0x2000 /* more fragments (not last frag) */ #define IP_OFFMASK 0x1fff /* mask for fragment offset */ /* * Time-to-live (ip_ttl), seconds */ #define IP_TTL_DEFAULT 64 /* default ttl, RFC 1122, RFC 1340 */ #define IP_TTL_MAX 255 /* maximum ttl */ /* * Protocol (ip_p) - http://www.iana.org/assignments/protocol-numbers */ #define IP_PROTO_IP 0 /* dummy for IP */ #define IP_PROTO_HOPOPTS IP_PROTO_IP /* IPv6 hop-by-hop options */ #define IP_PROTO_ICMP 1 /* ICMP */ #define IP_PROTO_IGMP 2 /* IGMP */ #define IP_PROTO_GGP 3 /* gateway-gateway protocol */ #define IP_PROTO_IPIP 4 /* IP in IP */ #define IP_PROTO_ST 5 /* ST datagram mode */ #define IP_PROTO_TCP 6 /* TCP */ #define IP_PROTO_CBT 7 /* CBT */ #define IP_PROTO_EGP 8 /* exterior gateway protocol */ #define IP_PROTO_IGP 9 /* interior gateway protocol */ #define IP_PROTO_BBNRCC 10 /* BBN RCC monitoring */ #define IP_PROTO_NVP 11 /* Network Voice Protocol */ #define IP_PROTO_PUP 12 /* PARC universal packet */ #define IP_PROTO_ARGUS 13 /* ARGUS */ #define IP_PROTO_EMCON 14 /* EMCON */ #define IP_PROTO_XNET 15 /* Cross Net Debugger */ #define IP_PROTO_CHAOS 16 /* Chaos */ #define IP_PROTO_UDP 17 /* UDP */ #define IP_PROTO_MUX 18 /* multiplexing */ #define IP_PROTO_DCNMEAS 19 /* DCN measurement */ #define IP_PROTO_HMP 20 /* Host Monitoring Protocol */ #define IP_PROTO_PRM 21 /* Packet Radio Measurement */ #define IP_PROTO_IDP 22 /* Xerox NS IDP */ #define IP_PROTO_TRUNK1 23 /* Trunk-1 */ #define IP_PROTO_TRUNK2 24 /* Trunk-2 */ #define IP_PROTO_LEAF1 25 /* Leaf-1 */ #define IP_PROTO_LEAF2 26 /* Leaf-2 */ #define IP_PROTO_RDP 27 /* "Reliable Datagram" proto */ #define IP_PROTO_IRTP 28 /* Inet Reliable Transaction */ #define IP_PROTO_TP 29 /* ISO TP class 4 */ #define IP_PROTO_NETBLT 30 /* Bulk Data Transfer */ #define IP_PROTO_MFPNSP 31 /* MFE Network Services */ #define IP_PROTO_MERITINP 32 /* Merit Internodal Protocol */ #define IP_PROTO_SEP 33 /* Sequential Exchange proto */ #define IP_PROTO_3PC 34 /* Third Party Connect proto */ #define IP_PROTO_IDPR 35 /* Interdomain Policy Route */ #define IP_PROTO_XTP 36 /* Xpress Transfer Protocol */ #define IP_PROTO_DDP 37 /* Datagram Delivery Proto */ #define IP_PROTO_CMTP 38 /* IDPR Ctrl Message Trans */ #define IP_PROTO_TPPP 39 /* TP++ Transport Protocol */ #define IP_PROTO_IL 40 /* IL Transport Protocol */ #define IP_PROTO_IPV6 41 /* IPv6 */ #define IP_PROTO_SDRP 42 /* Source Demand Routing */ #define IP_PROTO_ROUTING 43 /* IPv6 routing header */ #define IP_PROTO_FRAGMENT 44 /* IPv6 fragmentation header */ #define IP_PROTO_RSVP 46 /* Reservation protocol */ #define IP_PROTO_GRE 47 /* General Routing Encap */ #define IP_PROTO_MHRP 48 /* Mobile Host Routing */ #define IP_PROTO_ENA 49 /* ENA */ #define IP_PROTO_ESP 50 /* Encap Security Payload */ #define IP_PROTO_AH 51 /* Authentication Header */ #define IP_PROTO_INLSP 52 /* Integated Net Layer Sec */ #define IP_PROTO_SWIPE 53 /* SWIPE */ #define IP_PROTO_NARP 54 /* NBMA Address Resolution */ #define IP_PROTO_MOBILE 55 /* Mobile IP, RFC 2004 */ #define IP_PROTO_TLSP 56 /* Transport Layer Security */ #define IP_PROTO_SKIP 57 /* SKIP */ #define IP_PROTO_ICMPV6 58 /* ICMP for IPv6 */ #define IP_PROTO_NONE 59 /* IPv6 no next header */ #define IP_PROTO_DSTOPTS 60 /* IPv6 destination options */ #define IP_PROTO_ANYHOST 61 /* any host internal proto */ #define IP_PROTO_CFTP 62 /* CFTP */ #define IP_PROTO_ANYNET 63 /* any local network */ #define IP_PROTO_EXPAK 64 /* SATNET and Backroom EXPAK */ #define IP_PROTO_KRYPTOLAN 65 /* Kryptolan */ #define IP_PROTO_RVD 66 /* MIT Remote Virtual Disk */ #define IP_PROTO_IPPC 67 /* Inet Pluribus Packet Core */ #define IP_PROTO_DISTFS 68 /* any distributed fs */ #define IP_PROTO_SATMON 69 /* SATNET Monitoring */ #define IP_PROTO_VISA 70 /* VISA Protocol */ #define IP_PROTO_IPCV 71 /* Inet Packet Core Utility */ #define IP_PROTO_CPNX 72 /* Comp Proto Net Executive */ #define IP_PROTO_CPHB 73 /* Comp Protocol Heart Beat */ #define IP_PROTO_WSN 74 /* Wang Span Network */ #define IP_PROTO_PVP 75 /* Packet Video Protocol */ #define IP_PROTO_BRSATMON 76 /* Backroom SATNET Monitor */ #define IP_PROTO_SUNND 77 /* SUN ND Protocol */ #define IP_PROTO_WBMON 78 /* WIDEBAND Monitoring */ #define IP_PROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ #define IP_PROTO_EON 80 /* ISO CNLP */ #define IP_PROTO_VMTP 81 /* Versatile Msg Transport*/ #define IP_PROTO_SVMTP 82 /* Secure VMTP */ #define IP_PROTO_VINES 83 /* VINES */ #define IP_PROTO_TTP 84 /* TTP */ #define IP_PROTO_NSFIGP 85 /* NSFNET-IGP */ #define IP_PROTO_DGP 86 /* Dissimilar Gateway Proto */ #define IP_PROTO_TCF 87 /* TCF */ #define IP_PROTO_EIGRP 88 /* EIGRP */ #define IP_PROTO_OSPF 89 /* Open Shortest Path First */ #define IP_PROTO_SPRITERPC 90 /* Sprite RPC Protocol */ #define IP_PROTO_LARP 91 /* Locus Address Resolution */ #define IP_PROTO_MTP 92 /* Multicast Transport Proto */ #define IP_PROTO_AX25 93 /* AX.25 Frames */ #define IP_PROTO_IPIPENCAP 94 /* yet-another IP encap */ #define IP_PROTO_MICP 95 /* Mobile Internet Ctrl */ #define IP_PROTO_SCCSP 96 /* Semaphore Comm Sec Proto */ #define IP_PROTO_ETHERIP 97 /* Ethernet in IPv4 */ #define IP_PROTO_ENCAP 98 /* encapsulation header */ #define IP_PROTO_ANYENC 99 /* private encryption scheme */ #define IP_PROTO_GMTP 100 /* GMTP */ #define IP_PROTO_IFMP 101 /* Ipsilon Flow Mgmt Proto */ #define IP_PROTO_PNNI 102 /* PNNI over IP */ #define IP_PROTO_PIM 103 /* Protocol Indep Multicast */ #define IP_PROTO_ARIS 104 /* ARIS */ #define IP_PROTO_SCPS 105 /* SCPS */ #define IP_PROTO_QNX 106 /* QNX */ #define IP_PROTO_AN 107 /* Active Networks */ #define IP_PROTO_IPCOMP 108 /* IP Payload Compression */ #define IP_PROTO_SNP 109 /* Sitara Networks Protocol */ #define IP_PROTO_COMPAQPEER 110 /* Compaq Peer Protocol */ #define IP_PROTO_IPXIP 111 /* IPX in IP */ #define IP_PROTO_VRRP 112 /* Virtual Router Redundancy */ #define IP_PROTO_PGM 113 /* PGM Reliable Transport */ #define IP_PROTO_ANY0HOP 114 /* 0-hop protocol */ #define IP_PROTO_L2TP 115 /* Layer 2 Tunneling Proto */ #define IP_PROTO_DDX 116 /* D-II Data Exchange (DDX) */ #define IP_PROTO_IATP 117 /* Interactive Agent Xfer */ #define IP_PROTO_STP 118 /* Schedule Transfer Proto */ #define IP_PROTO_SRP 119 /* SpectraLink Radio Proto */ #define IP_PROTO_UTI 120 /* UTI */ #define IP_PROTO_SMP 121 /* Simple Message Protocol */ #define IP_PROTO_SM 122 /* SM */ #define IP_PROTO_PTP 123 /* Performance Transparency */ #define IP_PROTO_ISIS 124 /* ISIS over IPv4 */ #define IP_PROTO_FIRE 125 /* FIRE */ #define IP_PROTO_CRTP 126 /* Combat Radio Transport */ #define IP_PROTO_CRUDP 127 /* Combat Radio UDP */ #define IP_PROTO_SSCOPMCE 128 /* SSCOPMCE */ #define IP_PROTO_IPLT 129 /* IPLT */ #define IP_PROTO_SPS 130 /* Secure Packet Shield */ #define IP_PROTO_PIPE 131 /* Private IP Encap in IP */ #define IP_PROTO_SCTP 132 /* Stream Ctrl Transmission */ #define IP_PROTO_FC 133 /* Fibre Channel */ #define IP_PROTO_RSVPIGN 134 /* RSVP-E2E-IGNORE */ #define IP_PROTO_RAW 255 /* Raw IP packets */ #define IP_PROTO_RESERVED IP_PROTO_RAW /* Reserved */ #define IP_PROTO_MAX 255 /* * Option types (opt_type) - http://www.iana.org/assignments/ip-parameters */ #define IP_OPT_CONTROL 0x00 /* control */ #define IP_OPT_DEBMEAS 0x40 /* debugging & measurement */ #define IP_OPT_COPY 0x80 /* copy into all fragments */ #define IP_OPT_RESERVED1 0x20 #define IP_OPT_RESERVED2 0x60 #define IP_OPT_EOL 0 /* end of option list */ #define IP_OPT_NOP 1 /* no operation */ #define IP_OPT_SEC (2|IP_OPT_COPY) /* DoD basic security */ #define IP_OPT_LSRR (3|IP_OPT_COPY) /* loose source route */ #define IP_OPT_TS (4|IP_OPT_DEBMEAS) /* timestamp */ #define IP_OPT_ESEC (5|IP_OPT_COPY) /* DoD extended security */ #define IP_OPT_CIPSO (6|IP_OPT_COPY) /* commercial security */ #define IP_OPT_RR 7 /* record route */ #define IP_OPT_SATID (8|IP_OPT_COPY) /* stream ID (obsolete) */ #define IP_OPT_SSRR (9|IP_OPT_COPY) /* strict source route */ #define IP_OPT_ZSU 10 /* experimental measurement */ #define IP_OPT_MTUP 11 /* MTU probe */ #define IP_OPT_MTUR 12 /* MTU reply */ #define IP_OPT_FINN (13|IP_OPT_COPY|IP_OPT_DEBMEAS) /* exp flow control */ #define IP_OPT_VISA (14|IP_OPT_COPY) /* exp access control */ #define IP_OPT_ENCODE 15 /* ??? */ #define IP_OPT_IMITD (16|IP_OPT_COPY) /* IMI traffic descriptor */ #define IP_OPT_EIP (17|IP_OPT_COPY) /* extended IP, RFC 1385 */ #define IP_OPT_TR (18|IP_OPT_DEBMEAS) /* traceroute */ #define IP_OPT_ADDEXT (19|IP_OPT_COPY) /* IPv7 ext addr, RFC 1475 */ #define IP_OPT_RTRALT (20|IP_OPT_COPY) /* router alert, RFC 2113 */ #define IP_OPT_SDB (21|IP_OPT_COPY) /* directed bcast, RFC 1770 */ #define IP_OPT_NSAPA (22|IP_OPT_COPY) /* NSAP addresses */ #define IP_OPT_DPS (23|IP_OPT_COPY) /* dynamic packet state */ #define IP_OPT_UMP (24|IP_OPT_COPY) /* upstream multicast */ #define IP_OPT_MAX 25 #define IP_OPT_COPIED(o) ((o) & 0x80) #define IP_OPT_CLASS(o) ((o) & 0x60) #define IP_OPT_NUMBER(o) ((o) & 0x1f) #define IP_OPT_TYPEONLY(o) ((o) == IP_OPT_EOL || (o) == IP_OPT_NOP) /* * Security option data - RFC 791, 3.1 */ struct ip_opt_data_sec { uint16_t s; /* security */ uint16_t c; /* compartments */ uint16_t h; /* handling restrictions */ uint8_t tcc[3]; /* transmission control code */ } __attribute__((__packed__)); #define IP_OPT_SEC_UNCLASS 0x0000 /* unclassified */ #define IP_OPT_SEC_CONFID 0xf135 /* confidential */ #define IP_OPT_SEC_EFTO 0x789a /* EFTO */ #define IP_OPT_SEC_MMMM 0xbc4d /* MMMM */ #define IP_OPT_SEC_PROG 0x5e26 /* PROG */ #define IP_OPT_SEC_RESTR 0xaf13 /* restricted */ #define IP_OPT_SEC_SECRET 0xd788 /* secret */ #define IP_OPT_SEC_TOPSECRET 0x6bc5 /* top secret */ /* * {Loose Source, Record, Strict Source} Route option data - RFC 791, 3.1 */ struct ip_opt_data_rr { uint8_t ptr; /* from start of option, >= 4 */ uint32_t iplist __flexarr; /* list of IP addresses */ } __attribute__((__packed__)); /* * Timestamp option data - RFC 791, 3.1 */ struct ip_opt_data_ts { uint8_t ptr; /* from start of option, >= 5 */ #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t oflw:4, /* number of IPs skipped */ flg:4; /* address[ / timestamp] flag */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t flg:4, oflw:4; #endif uint32_t ipts __flexarr; /* IP address [/ timestamp] pairs */ } __attribute__((__packed__)); #define IP_OPT_TS_TSONLY 0 /* timestamps only */ #define IP_OPT_TS_TSADDR 1 /* IP address / timestamp pairs */ #define IP_OPT_TS_PRESPEC 3 /* IP address / zero timestamp pairs */ /* * Traceroute option data - RFC 1393, 2.2 */ struct ip_opt_data_tr { uint16_t id; /* ID number */ uint16_t ohc; /* outbound hop count */ uint16_t rhc; /* return hop count */ uint32_t origip; /* originator IP address */ } __attribute__((__packed__)); /* * IP option (following IP header) */ struct ip_opt { uint8_t opt_type; /* option type */ uint8_t opt_len; /* option length >= IP_OPT_LEN */ union ip_opt_data { struct ip_opt_data_sec sec; /* IP_OPT_SEC */ struct ip_opt_data_rr rr; /* IP_OPT_{L,S}RR */ struct ip_opt_data_ts ts; /* IP_OPT_TS */ uint16_t satid; /* IP_OPT_SATID */ uint16_t mtu; /* IP_OPT_MTU{P,R} */ struct ip_opt_data_tr tr; /* IP_OPT_TR */ uint32_t addext[2]; /* IP_OPT_ADDEXT */ uint16_t rtralt; /* IP_OPT_RTRALT */ uint32_t sdb[9]; /* IP_OPT_SDB */ uint8_t data8[IP_OPT_LEN_MAX - IP_OPT_LEN]; } opt_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif /* * Classful addressing */ #define IP_CLASSA(i) (((uint32_t)(i) & htonl(0x80000000)) == \ htonl(0x00000000)) #define IP_CLASSA_NET (htonl(0xff000000)) #define IP_CLASSA_NSHIFT 24 #define IP_CLASSA_HOST (htonl(0x00ffffff)) #define IP_CLASSA_MAX 128 #define IP_CLASSB(i) (((uint32_t)(i) & htonl(0xc0000000)) == \ htonl(0x80000000)) #define IP_CLASSB_NET (htonl(0xffff0000)) #define IP_CLASSB_NSHIFT 16 #define IP_CLASSB_HOST (htonl(0x0000ffff)) #define IP_CLASSB_MAX 65536 #define IP_CLASSC(i) (((uint32_t)(i) & htonl(0xe0000000)) == \ htonl(0xc0000000)) #define IP_CLASSC_NET (htonl(0xffffff00)) #define IP_CLASSC_NSHIFT 8 #define IP_CLASSC_HOST (htonl(0x000000ff)) #define IP_CLASSD(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xe0000000)) /* These ones aren't really net and host fields, but routing needn't know. */ #define IP_CLASSD_NET (htonl(0xf0000000)) #define IP_CLASSD_NSHIFT 28 #define IP_CLASSD_HOST (htonl(0x0fffffff)) #define IP_MULTICAST(i) IP_CLASSD(i) #define IP_EXPERIMENTAL(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) #define IP_BADCLASS(i) (((uint32_t)(i) & htonl(0xf0000000)) == \ htonl(0xf0000000)) #define IP_LOCAL_GROUP(i) (((uint32_t)(i) & htonl(0xffffff00)) == \ htonl(0xe0000000)) /* * Reserved addresses */ #define IP_ADDR_ANY (htonl(0x00000000)) /* 0.0.0.0 */ #define IP_ADDR_BROADCAST (htonl(0xffffffff)) /* 255.255.255.255 */ #define IP_ADDR_LOOPBACK (htonl(0x7f000001)) /* 127.0.0.1 */ #define IP_ADDR_MCAST_ALL (htonl(0xe0000001)) /* 224.0.0.1 */ #define IP_ADDR_MCAST_LOCAL (htonl(0xe00000ff)) /* 224.0.0.255 */ #define ip_pack_hdr(hdr, tos, len, id, off, ttl, p, src, dst) do { \ struct ip_hdr *ip_pack_p = (struct ip_hdr *)(hdr); \ ip_pack_p->ip_v = 4; ip_pack_p->ip_hl = 5; \ ip_pack_p->ip_tos = tos; ip_pack_p->ip_len = htons(len); \ ip_pack_p->ip_id = htons(id); ip_pack_p->ip_off = htons(off); \ ip_pack_p->ip_ttl = ttl; ip_pack_p->ip_p = p; \ ip_pack_p->ip_src = src; ip_pack_p->ip_dst = dst; \ } while (0) typedef struct ip_handle ip_t; __BEGIN_DECLS ip_t *ip_open(void); ssize_t ip_send(ip_t *i, const void *buf, size_t len); ip_t *ip_close(ip_t *i); char *ip_ntop(const ip_addr_t *ip, char *dst, size_t len); int ip_pton(const char *src, ip_addr_t *dst); char *ip_ntoa(const ip_addr_t *ip); #define ip_aton ip_pton ssize_t ip_add_option(void *buf, size_t len, int proto, const void *optbuf, size_t optlen); void ip_checksum(void *buf, size_t len); int ip_cksum_add(const void *buf, size_t len, int cksum); #define ip_cksum_carry(x) \ (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff)) __END_DECLS #endif /* DNET_IP_H */ libdnet-1.12/trunk/include/dnet/ip6.h0000644000076500007650000001262110016347553020623 0ustar dugsongdugsong00000000000000/* * ip6.h * * Internet Protocol, Version 6 (RFC 2460). * * Copyright (c) 2002 Dug Song * * $Id: ip6.h 486 2004-02-23 10:01:15Z dugsong $ */ #ifndef DNET_IP6_H #define DNET_IP6_H #define IP6_ADDR_LEN 16 #define IP6_ADDR_BITS 128 #define IP6_HDR_LEN 40 /* IPv6 header length */ #define IP6_LEN_MIN IP6_HDR_LEN #define IP6_LEN_MAX 65535 /* non-jumbo payload */ #define IP6_MTU_MIN 1280 /* minimum MTU (1024 + 256) */ typedef struct ip6_addr { uint8_t data[IP6_ADDR_LEN]; } ip6_addr_t; #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * IPv6 header */ struct ip6_hdr { union { struct ip6_hdr_ctl { uint32_t ip6_un1_flow; /* 20 bits of flow ID */ uint16_t ip6_un1_plen; /* payload length */ uint8_t ip6_un1_nxt; /* next header */ uint8_t ip6_un1_hlim; /* hop limit */ } ip6_un1; uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ } ip6_ctlun; ip6_addr_t ip6_src; ip6_addr_t ip6_dst; } __attribute__((__packed__)); #define ip6_vfc ip6_ctlun.ip6_un2_vfc #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt /* IP_PROTO_* */ #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim #define IP6_VERSION 0x60 #define IP6_VERSION_MASK 0xf0 /* ip6_vfc version */ #if DNET_BYTESEX == DNET_BIG_ENDIAN #define IP6_FLOWINFO_MASK 0x0fffffff /* ip6_flow info (28 bits) */ #define IP6_FLOWLABEL_MASK 0x000fffff /* ip6_flow label (20 bits) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN #define IP6_FLOWINFO_MASK 0xffffff0f /* ip6_flow info (28 bits) */ #define IP6_FLOWLABEL_MASK 0xffff0f00 /* ip6_flow label (20 bits) */ #endif /* * Hop limit (ip6_hlim) */ #define IP6_HLIM_DEFAULT 64 #define IP6_HLIM_MAX 255 /* * Preferred extension header order from RFC 2460, 4.1: * * IP_PROTO_IPV6, IP_PROTO_HOPOPTS, IP_PROTO_DSTOPTS, IP_PROTO_ROUTING, * IP_PROTO_FRAGMENT, IP_PROTO_AH, IP_PROTO_ESP, IP_PROTO_DSTOPTS, IP_PROTO_* */ /* * Routing header data (IP_PROTO_ROUTING) */ struct ip6_ext_data_routing { uint8_t type; /* routing type */ uint8_t segleft; /* segments left */ /* followed by routing type specific data */ } __attribute__((__packed__)); struct ip6_ext_data_routing0 { uint8_t type; /* always zero */ uint8_t segleft; /* segments left */ uint8_t reserved; /* reserved field */ uint8_t slmap[3]; /* strict/loose bit map */ ip6_addr_t addr[1]; /* up to 23 addresses */ } __attribute__((__packed__)); /* * Fragment header data (IP_PROTO_FRAGMENT) */ struct ip6_ext_data_fragment { uint16_t offlg; /* offset, reserved, and flag */ uint32_t ident; /* identification */ } __attribute__((__packed__)); /* * Fragmentation offset, reserved, and flags (offlg) */ #if DNET_BYTESEX == DNET_BIG_ENDIAN #define IP6_OFF_MASK 0xfff8 /* mask out offset from offlg */ #define IP6_RESERVED_MASK 0x0006 /* reserved bits in offlg */ #define IP6_MORE_FRAG 0x0001 /* more-fragments flag */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN #define IP6_OFF_MASK 0xf8ff /* mask out offset from offlg */ #define IP6_RESERVED_MASK 0x0600 /* reserved bits in offlg */ #define IP6_MORE_FRAG 0x0100 /* more-fragments flag */ #endif /* * Option types, for IP_PROTO_HOPOPTS, IP_PROTO_DSTOPTS headers */ #define IP6_OPT_PAD1 0x00 /* 00 0 00000 */ #define IP6_OPT_PADN 0x01 /* 00 0 00001 */ #define IP6_OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ #define IP6_OPT_JUMBO_LEN 6 #define IP6_OPT_RTALERT 0x05 /* 00 0 00101 */ #define IP6_OPT_RTALERT_LEN 4 #define IP6_OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ #define IP6_OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ #define IP6_OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ #define IP6_OPT_LEN_MIN 2 #define IP6_OPT_TYPE(o) ((o) & 0xC0) /* high 2 bits of opt_type */ #define IP6_OPT_TYPE_SKIP 0x00 /* continue processing on failure */ #define IP6_OPT_TYPE_DISCARD 0x40 /* discard packet on failure */ #define IP6_OPT_TYPE_FORCEICMP 0x80 /* discard and send ICMP on failure */ #define IP6_OPT_TYPE_ICMP 0xC0 /* ...only if non-multicast dst */ #define IP6_OPT_MUTABLE 0x20 /* option data may change en route */ /* * Extension header (chained via {ip6,ext}_nxt, following IPv6 header) */ struct ip6_ext_hdr { uint8_t ext_nxt; /* next header */ uint8_t ext_len; /* following length in units of 8 octets */ union { struct ip6_ext_data_routing routing; struct ip6_ext_data_fragment fragment; } ext_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif /* * Reserved addresses */ #define IP6_ADDR_UNSPEC \ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" #define IP6_ADDR_LOOPBACK \ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" #define ip6_pack_hdr(hdr, fc, fl, plen, nxt, hlim, src, dst) do { \ struct ip6_hdr *ip6 = (struct ip6_hdr *)(hdr); \ ip6->ip6_flow = htonl(((uint32_t)(fc) << 28) & \ (IP6_FLOWLABEL_MASK | (fl))); \ ip6->ip6_vfc = (IP6_VERSION | ((fc) >> 4)); \ ip6->ip6_plen = htons((plen)); \ ip6->ip6_nxt = (nxt); ip6->ip6_hlim = (hlim); \ memmove(&ip6->ip6_src, &(src), IP6_ADDR_LEN); \ memmove(&ip6->ip6_dst, &(dst), IP6_ADDR_LEN); \ } while (0); __BEGIN_DECLS char *ip6_ntop(const ip6_addr_t *ip6, char *dst, size_t size); int ip6_pton(const char *src, ip6_addr_t *dst); char *ip6_ntoa(const ip6_addr_t *ip6); #define ip6_aton ip6_pton void ip6_checksum(void *buf, size_t len); __END_DECLS #endif /* DNET_IP6_H */ libdnet-1.12/trunk/include/dnet/Makefile.am0000644000076500007650000000037610120211407021774 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 525 2004-09-10 02:35:51Z dugsong $ include $(top_srcdir)/Makefile.am.common dnetincludedir = $(includedir)/dnet dnetinclude_HEADERS = addr.h arp.h blob.h eth.h fw.h icmp.h intf.h ip.h \ ip6.h os.h rand.h route.h tcp.h tun.h udp.h libdnet-1.12/trunk/include/dnet/Makefile.in0000644000076500007650000001774110363627052022031 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include dnetincludedir = $(includedir)/dnet dnetinclude_HEADERS = addr.h arp.h blob.h eth.h fw.h icmp.h intf.h ip.h \ ip6.h os.h rand.h route.h tcp.h tun.h udp.h subdir = include/dnet mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = HEADERS = $(dnetinclude_HEADERS) DIST_COMMON = $(dnetinclude_HEADERS) Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/dnet/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: dnetincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-dnetincludeHEADERS: $(dnetinclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(dnetincludedir) @list='$(dnetinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(dnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(dnetincludedir)/$$f"; \ $(dnetincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(dnetincludedir)/$$f; \ done uninstall-dnetincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(dnetinclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(dnetincludedir)/$$f"; \ rm -f $(DESTDIR)$(dnetincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(dnetincludedir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-dnetincludeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-dnetincludeHEADERS uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am \ install-dnetincludeHEADERS install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool tags uninstall uninstall-am \ uninstall-dnetincludeHEADERS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libdnet-1.12/trunk/include/dnet/os.h0000644000076500007650000000611610204304424020535 0ustar dugsongdugsong00000000000000/* * os.h * * Sleazy OS-specific defines. * * Copyright (c) 2000 Dug Song * * $Id: os.h 583 2005-02-15 05:31:00Z dugsong $ */ #ifndef DNET_OS_H #define DNET_OS_H #ifdef _WIN32 # include # include /* XXX */ # undef IP_OPT_LSRR # undef IP_OPT_TS # undef IP_OPT_RR # undef IP_OPT_SSRR typedef u_char uint8_t; typedef u_short uint16_t; typedef u_int uint32_t; # ifndef __CYGWIN__ typedef long ssize_t; # endif #else # include # include # include # include # include # include # ifdef __bsdi__ # include typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; typedef u_int64_t uint64_t; # else # include # endif #endif #define DNET_LIL_ENDIAN 1234 #define DNET_BIG_ENDIAN 4321 /* BSD and IRIX */ #ifdef BYTE_ORDER #if BYTE_ORDER == LITTLE_ENDIAN # define DNET_BYTESEX DNET_LIL_ENDIAN #elif BYTE_ORDER == BIG_ENDIAN # define DNET_BYTESEX DNET_BIG_ENDIAN #endif #endif /* Linux */ #ifdef __BYTE_ORDER #if __BYTE_ORDER == __LITTLE_ENDIAN # define DNET_BYTESEX DNET_LIL_ENDIAN #elif __BYTE_ORDER == __BIG_ENDIAN # define DNET_BYTESEX DNET_BIG_ENDIAN #endif #endif /* Solaris */ #if defined(_BIT_FIELDS_LTOH) # define DNET_BYTESEX DNET_LIL_ENDIAN #elif defined (_BIT_FIELDS_HTOL) # define DNET_BYTESEX DNET_BIG_ENDIAN #endif /* Win32 - XXX */ #ifdef _WIN32 # define DNET_BYTESEX DNET_LIL_ENDIAN #endif /* Nastiness from old BIND code. */ #ifndef DNET_BYTESEX # if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ defined(__alpha__) || defined(__alpha) # define DNET_BYTESEX DNET_LIL_ENDIAN # elif defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ defined(__hp9000s300) || defined(__hp9000s700) || defined(__ia64) || \ defined (BIT_ZERO_ON_LEFT) || defined(m68k) # define DNET_BYTESEX DNET_BIG_ENDIAN # else # error "bytesex unknown" # endif #endif /* C++ support. */ #undef __BEGIN_DECLS #undef __END_DECLS #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } /* extern "C" */ #else # define __BEGIN_DECLS # define __END_DECLS #endif /* Support for flexible arrays. */ #undef __flexarr #if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)) /* GCC 2.97 supports C99 flexible array members. */ # define __flexarr [] #else # ifdef __GNUC__ # define __flexarr [0] # else # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define __flexarr [] # elif defined(_WIN32) /* MS VC++ */ # define __flexarr [] # else /* Some other non-C99 compiler. Approximate with [1]. */ # define __flexarr [1] # endif # endif #endif #endif /* DNET_OS_H */ libdnet-1.12/trunk/include/dnet/rand.h0000644000076500007650000000137607454113605021057 0ustar dugsongdugsong00000000000000/* * rand.h * * Pseudo-random number generation, based on OpenBSD arc4random(). * * Copyright (c) 2000 Dug Song * Copyright (c) 1996 David Mazieres * * $Id: rand.h 340 2002-04-07 19:01:25Z dugsong $ */ #ifndef DNET_RAND_H #define DNET_RAND_H typedef struct rand_handle rand_t; __BEGIN_DECLS rand_t *rand_open(void); int rand_get(rand_t *r, void *buf, size_t len); int rand_set(rand_t *r, const void *seed, size_t len); int rand_add(rand_t *r, const void *buf, size_t len); uint8_t rand_uint8(rand_t *r); uint16_t rand_uint16(rand_t *r); uint32_t rand_uint32(rand_t *r); int rand_shuffle(rand_t *r, void *base, size_t nmemb, size_t size); rand_t *rand_close(rand_t *r); __END_DECLS #endif /* DNET_RAND_H */ libdnet-1.12/trunk/include/dnet/route.h0000644000076500007650000000147507427404041021266 0ustar dugsongdugsong00000000000000/* * route.c * * Kernel route table operations. * * Copyright (c) 2000 Dug Song * * $Id: route.h 260 2002-02-04 04:03:45Z dugsong $ */ #ifndef DNET_ROUTE_H #define DNET_ROUTE_H /* * Routing table entry */ struct route_entry { struct addr route_dst; /* destination address */ struct addr route_gw; /* gateway address */ }; typedef struct route_handle route_t; typedef int (*route_handler)(const struct route_entry *entry, void *arg); __BEGIN_DECLS route_t *route_open(void); int route_add(route_t *r, const struct route_entry *entry); int route_delete(route_t *r, const struct route_entry *entry); int route_get(route_t *r, struct route_entry *entry); int route_loop(route_t *r, route_handler callback, void *arg); route_t *route_close(route_t *r); __END_DECLS #endif /* DNET_ROUTE_H */ libdnet-1.12/trunk/include/dnet/tcp.h0000644000076500007650000001216410016347643020715 0ustar dugsongdugsong00000000000000/* * tcp.h * * Transmission Control Protocol (RFC 793). * * Copyright (c) 2000 Dug Song * * $Id: tcp.h 487 2004-02-23 10:02:11Z dugsong $ */ #ifndef DNET_TCP_H #define DNET_TCP_H #define TCP_HDR_LEN 20 /* base TCP header length */ #define TCP_OPT_LEN 2 /* base TCP option length */ #define TCP_OPT_LEN_MAX 40 #define TCP_HDR_LEN_MAX (TCP_HDR_LEN + TCP_OPT_LEN_MAX) #ifndef __GNUC__ # define __attribute__(x) # pragma pack(1) #endif /* * TCP header, without options */ struct tcp_hdr { uint16_t th_sport; /* source port */ uint16_t th_dport; /* destination port */ uint32_t th_seq; /* sequence number */ uint32_t th_ack; /* acknowledgment number */ #if DNET_BYTESEX == DNET_BIG_ENDIAN uint8_t th_off:4, /* data offset */ th_x2:4; /* (unused) */ #elif DNET_BYTESEX == DNET_LIL_ENDIAN uint8_t th_x2:4, th_off:4; #else # error "need to include " #endif uint8_t th_flags; /* control flags */ uint16_t th_win; /* window */ uint16_t th_sum; /* checksum */ uint16_t th_urp; /* urgent pointer */ }; /* * TCP control flags (th_flags) */ #define TH_FIN 0x01 /* end of data */ #define TH_SYN 0x02 /* synchronize sequence numbers */ #define TH_RST 0x04 /* reset connection */ #define TH_PUSH 0x08 /* push */ #define TH_ACK 0x10 /* acknowledgment number set */ #define TH_URG 0x20 /* urgent pointer set */ #define TH_ECE 0x40 /* ECN echo, RFC 3168 */ #define TH_CWR 0x80 /* congestion window reduced */ #define TCP_PORT_MAX 65535 /* maximum port */ #define TCP_WIN_MAX 65535 /* maximum (unscaled) window */ /* * Sequence number comparison macros */ #define TCP_SEQ_LT(a,b) ((int)((a)-(b)) < 0) #define TCP_SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) #define TCP_SEQ_GT(a,b) ((int)((a)-(b)) > 0) #define TCP_SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) /* * TCP FSM states */ #define TCP_STATE_CLOSED 0 /* closed */ #define TCP_STATE_LISTEN 1 /* listening from connection */ #define TCP_STATE_SYN_SENT 2 /* active, have sent SYN */ #define TCP_STATE_SYN_RECEIVED 3 /* have sent and received SYN */ #define TCP_STATE_ESTABLISHED 4 /* established */ #define TCP_STATE_CLOSE_WAIT 5 /* rcvd FIN, waiting for close */ #define TCP_STATE_FIN_WAIT_1 6 /* have closed, sent FIN */ #define TCP_STATE_CLOSING 7 /* closed xchd FIN, await FIN-ACK */ #define TCP_STATE_LAST_ACK 8 /* had FIN and close, await FIN-ACK */ #define TCP_STATE_FIN_WAIT_2 9 /* have closed, FIN is acked */ #define TCP_STATE_TIME_WAIT 10 /* in 2*MSL quiet wait after close */ #define TCP_STATE_MAX 11 /* * Options (opt_type) - http://www.iana.org/assignments/tcp-parameters */ #define TCP_OPT_EOL 0 /* end of option list */ #define TCP_OPT_NOP 1 /* no operation */ #define TCP_OPT_MSS 2 /* maximum segment size */ #define TCP_OPT_WSCALE 3 /* window scale factor, RFC 1072 */ #define TCP_OPT_SACKOK 4 /* SACK permitted, RFC 2018 */ #define TCP_OPT_SACK 5 /* SACK, RFC 2018 */ #define TCP_OPT_ECHO 6 /* echo (obsolete), RFC 1072 */ #define TCP_OPT_ECHOREPLY 7 /* echo reply (obsolete), RFC 1072 */ #define TCP_OPT_TIMESTAMP 8 /* timestamp, RFC 1323 */ #define TCP_OPT_POCONN 9 /* partial order conn, RFC 1693 */ #define TCP_OPT_POSVC 10 /* partial order service, RFC 1693 */ #define TCP_OPT_CC 11 /* connection count, RFC 1644 */ #define TCP_OPT_CCNEW 12 /* CC.NEW, RFC 1644 */ #define TCP_OPT_CCECHO 13 /* CC.ECHO, RFC 1644 */ #define TCP_OPT_ALTSUM 14 /* alt checksum request, RFC 1146 */ #define TCP_OPT_ALTSUMDATA 15 /* alt checksum data, RFC 1146 */ #define TCP_OPT_SKEETER 16 /* Skeeter */ #define TCP_OPT_BUBBA 17 /* Bubba */ #define TCP_OPT_TRAILSUM 18 /* trailer checksum */ #define TCP_OPT_MD5 19 /* MD5 signature, RFC 2385 */ #define TCP_OPT_SCPS 20 /* SCPS capabilities */ #define TCP_OPT_SNACK 21 /* selective negative acks */ #define TCP_OPT_REC 22 /* record boundaries */ #define TCP_OPT_CORRUPT 23 /* corruption experienced */ #define TCP_OPT_SNAP 24 /* SNAP */ #define TCP_OPT_TCPCOMP 26 /* TCP compression filter */ #define TCP_OPT_MAX 27 #define TCP_OPT_TYPEONLY(type) \ ((type) == TCP_OPT_EOL || (type) == TCP_OPT_NOP) /* * TCP option (following TCP header) */ struct tcp_opt { uint8_t opt_type; /* option type */ uint8_t opt_len; /* option length >= TCP_OPT_LEN */ union tcp_opt_data { uint16_t mss; /* TCP_OPT_MSS */ uint8_t wscale; /* TCP_OPT_WSCALE */ uint16_t sack[19]; /* TCP_OPT_SACK */ uint32_t echo; /* TCP_OPT_ECHO{REPLY} */ uint32_t timestamp[2]; /* TCP_OPT_TIMESTAMP */ uint32_t cc; /* TCP_OPT_CC{NEW,ECHO} */ uint8_t cksum; /* TCP_OPT_ALTSUM */ uint8_t md5[16]; /* TCP_OPT_MD5 */ uint8_t data8[TCP_OPT_LEN_MAX - TCP_OPT_LEN]; } opt_data; } __attribute__((__packed__)); #ifndef __GNUC__ # pragma pack() #endif #define tcp_pack_hdr(hdr, sport, dport, seq, ack, flags, win, urp) do { \ struct tcp_hdr *tcp_pack_p = (struct tcp_hdr *)(hdr); \ tcp_pack_p->th_sport = htons(sport); \ tcp_pack_p->th_dport = htons(dport); \ tcp_pack_p->th_seq = htonl(seq); \ tcp_pack_p->th_ack = htonl(ack); \ tcp_pack_p->th_x2 = 0; tcp_pack_p->th_off = 5; \ tcp_pack_p->th_flags = flags; \ tcp_pack_p->th_win = htons(win); \ tcp_pack_p->th_urp = htons(urp); \ } while (0) #endif /* DNET_TCP_H */ libdnet-1.12/trunk/include/dnet/tun.h0000644000076500007650000000105410175535200020723 0ustar dugsongdugsong00000000000000/* * tun.h * * Network tunnel device. * * Copyright (c) 2001 Dug Song * * $Id: tun.h 547 2005-01-25 21:30:40Z dugsong $ */ #ifndef DNET_TUN_H #define DNET_TUN_H typedef struct tun tun_t; __BEGIN_DECLS tun_t *tun_open(struct addr *src, struct addr *dst, int mtu); int tun_fileno(tun_t *tun); const char *tun_name(tun_t *tun); ssize_t tun_send(tun_t *tun, const void *buf, size_t size); ssize_t tun_recv(tun_t *tun, void *buf, size_t size); tun_t *tun_close(tun_t *tun); __END_DECLS #endif /* DNET_TUN_H */ libdnet-1.12/trunk/include/dnet/udp.h0000644000076500007650000000132107452236043020711 0ustar dugsongdugsong00000000000000/* * udp.h * * User Datagram Protocol (RFC 768). * * Copyright (c) 2000 Dug Song * * $Id: udp.h 330 2002-04-02 05:05:39Z dugsong $ */ #ifndef DNET_UDP_H #define DNET_UDP_H #define UDP_HDR_LEN 8 struct udp_hdr { uint16_t uh_sport; /* source port */ uint16_t uh_dport; /* destination port */ uint16_t uh_ulen; /* udp length (including header) */ uint16_t uh_sum; /* udp checksum */ }; #define UDP_PORT_MAX 65535 #define udp_pack_hdr(hdr, sport, dport, ulen) do { \ struct udp_hdr *udp_pack_p = (struct udp_hdr *)(hdr); \ udp_pack_p->uh_sport = htons(sport); \ udp_pack_p->uh_dport = htons(dport); \ udp_pack_p->uh_ulen = htons(ulen); \ } while (0) #endif /* DNET_UDP_H */ libdnet-1.12/trunk/include/dnet.h0000644000076500007650000000100310120215411020074 0ustar dugsongdugsong00000000000000/* * dnet.h * * Copyright (c) 2001 Dug Song * * $Id: dnet.h 529 2004-09-10 03:10:01Z dugsong $ */ #ifndef DNET_H #define DNET_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /* DNET_H */ libdnet-1.12/trunk/include/err.h0000644000076500007650000000421607361523034017763 0ustar dugsongdugsong00000000000000/* * err.h * * Adapted from OpenBSD libc *err* *warn* code. * * Copyright (c) 2000 Dug Song * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)err.h 8.1 (Berkeley) 6/2/93 */ #ifndef _ERR_H_ #define _ERR_H_ void err(int eval, const char *fmt, ...); void warn(const char *fmt, ...); void errx(int eval, const char *fmt, ...); void warnx(const char *fmt, ...); #endif /* !_ERR_H_ */ libdnet-1.12/trunk/include/Makefile.am0000644000076500007650000000024707434771544021072 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 294 2002-02-20 19:05:08Z dugsong $ include $(top_srcdir)/Makefile.am.common include_HEADERS = dnet.h SUBDIRS = dnet EXTRA_DIST = err.h queue.h libdnet-1.12/trunk/include/Makefile.in0000644000076500007650000002712610363627052021075 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include include_HEADERS = dnet.h SUBDIRS = dnet EXTRA_DIST = err.h queue.h subdir = include mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = HEADERS = $(include_HEADERS) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = $(include_HEADERS) Makefile.am Makefile.in config.h.in DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: includeHEADERS_INSTALL = $(INSTALL_HEADER) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \ $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(includedir)/$$f"; \ rm -f $(DESTDIR)$(includedir)/$$f; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(includedir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-includeHEADERS install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-includeHEADERS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am \ dvi-recursive info info-am info-recursive install install-am \ install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-includeHEADERS install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am \ uninstall-includeHEADERS uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/trunk/include/queue.h0000644000076500007650000004162407427405124020325 0ustar dugsongdugsong00000000000000/* $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ /* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines five types of data structures: singly-linked lists, * lists, simple queues, tail queues, and circular queues. * * * A singly-linked list is headed by a single forward pointer. The elements * are singly linked for minimum space and pointer manipulation overhead at * the expense of O(n) removal for arbitrary elements. New elements can be * added to the list after an existing element or at the head of the list. * Elements being removed from the head of the list should use the explicit * macro for this purpose for optimum efficiency. A singly-linked list may * only be traversed in the forward direction. Singly-linked lists are ideal * for applications with large datasets and few or no removals or for * implementing a LIFO queue. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A simple queue is headed by a pair of pointers, one the head of the * list and the other to the tail of the list. The elements are singly * linked to save space, so elements can only be removed from the * head of the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the * list. A simple queue may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may be traversed in either direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the list. * A circle queue may be traversed in either direction, but has a more * complex end of list detection. * * For details on the use of these macros, see the queue(3) manual page. */ /* * Singly-linked List definitions. */ #define SLIST_HEAD(name, type) \ struct name { \ struct type *slh_first; /* first element */ \ } #define SLIST_HEAD_INITIALIZER(head) \ { NULL } #define SLIST_ENTRY(type) \ struct { \ struct type *sle_next; /* next element */ \ } /* * Singly-linked List access methods. */ #define SLIST_FIRST(head) ((head)->slh_first) #define SLIST_END(head) NULL #define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_FOREACH(var, head, field) \ for((var) = SLIST_FIRST(head); \ (var) != SLIST_END(head); \ (var) = SLIST_NEXT(var, field)) /* * Singly-linked List functions. */ #define SLIST_INIT(head) { \ SLIST_FIRST(head) = SLIST_END(head); \ } #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ (elm)->field.sle_next = (slistelm)->field.sle_next; \ (slistelm)->field.sle_next = (elm); \ } while (0) #define SLIST_INSERT_HEAD(head, elm, field) do { \ (elm)->field.sle_next = (head)->slh_first; \ (head)->slh_first = (elm); \ } while (0) #define SLIST_REMOVE_HEAD(head, field) do { \ (head)->slh_first = (head)->slh_first->field.sle_next; \ } while (0) #define SLIST_REMOVE(head, elm, type, field) do { \ if ((head)->slh_first == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ struct type *curelm = (head)->slh_first; \ while( curelm->field.sle_next != (elm) ) \ curelm = curelm->field.sle_next; \ curelm->field.sle_next = \ curelm->field.sle_next->field.sle_next; \ } \ } while (0) /* * List definitions. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_HEAD_INITIALIZER(head) \ { NULL } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } /* * List access methods */ #define LIST_FIRST(head) ((head)->lh_first) #define LIST_END(head) NULL #define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_FOREACH(var, head, field) \ for((var) = LIST_FIRST(head); \ (var)!= LIST_END(head); \ (var) = LIST_NEXT(var, field)) /* * List functions. */ #define LIST_INIT(head) do { \ LIST_FIRST(head) = LIST_END(head); \ } while (0) #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ (listelm)->field.le_next->field.le_prev = \ &(elm)->field.le_next; \ (listelm)->field.le_next = (elm); \ (elm)->field.le_prev = &(listelm)->field.le_next; \ } while (0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ (elm)->field.le_next = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &(elm)->field.le_next; \ } while (0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.le_next = (head)->lh_first) != NULL) \ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ (head)->lh_first = (elm); \ (elm)->field.le_prev = &(head)->lh_first; \ } while (0) #define LIST_REMOVE(elm, field) do { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = (elm)->field.le_next; \ } while (0) #define LIST_REPLACE(elm, elm2, field) do { \ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \ (elm2)->field.le_next->field.le_prev = \ &(elm2)->field.le_next; \ (elm2)->field.le_prev = (elm)->field.le_prev; \ *(elm2)->field.le_prev = (elm2); \ } while (0) /* * Simple queue definitions. */ #define SIMPLEQ_HEAD(name, type) \ struct name { \ struct type *sqh_first; /* first element */ \ struct type **sqh_last; /* addr of last next element */ \ } #define SIMPLEQ_HEAD_INITIALIZER(head) \ { NULL, &(head).sqh_first } #define SIMPLEQ_ENTRY(type) \ struct { \ struct type *sqe_next; /* next element */ \ } /* * Simple queue access methods. */ #define SIMPLEQ_FIRST(head) ((head)->sqh_first) #define SIMPLEQ_END(head) NULL #define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) #define SIMPLEQ_FOREACH(var, head, field) \ for((var) = SIMPLEQ_FIRST(head); \ (var) != SIMPLEQ_END(head); \ (var) = SIMPLEQ_NEXT(var, field)) /* * Simple queue functions. */ #define SIMPLEQ_INIT(head) do { \ (head)->sqh_first = NULL; \ (head)->sqh_last = &(head)->sqh_first; \ } while (0) #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ (head)->sqh_last = &(elm)->field.sqe_next; \ (head)->sqh_first = (elm); \ } while (0) #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.sqe_next = NULL; \ *(head)->sqh_last = (elm); \ (head)->sqh_last = &(elm)->field.sqe_next; \ } while (0) #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ (head)->sqh_last = &(elm)->field.sqe_next; \ (listelm)->field.sqe_next = (elm); \ } while (0) #define SIMPLEQ_REMOVE_HEAD(head, elm, field) do { \ if (((head)->sqh_first = (elm)->field.sqe_next) == NULL) \ (head)->sqh_last = &(head)->sqh_first; \ } while (0) /* * Tail queue definitions. */ #define TAILQ_HEAD(name, type) \ struct name { \ struct type *tqh_first; /* first element */ \ struct type **tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } #define TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ } /* * tail queue access methods */ #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_END(head) NULL #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) /* XXX */ #define TAILQ_PREV(elm, headname, field) \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) #define TAILQ_EMPTY(head) \ (TAILQ_FIRST(head) == TAILQ_END(head)) #define TAILQ_FOREACH(var, head, field) \ for((var) = TAILQ_FIRST(head); \ (var) != TAILQ_END(head); \ (var) = TAILQ_NEXT(var, field)) #define TAILQ_FOREACH_REVERSE(var, head, field, headname) \ for((var) = TAILQ_LAST(head, headname); \ (var) != TAILQ_END(head); \ (var) = TAILQ_PREV(var, headname, field)) /* * Tail queue functions. */ #define TAILQ_INIT(head) do { \ (head)->tqh_first = NULL; \ (head)->tqh_last = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ (head)->tqh_first->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_first = (elm); \ (elm)->field.tqe_prev = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.tqe_next = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ (elm)->field.tqe_next->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (listelm)->field.tqe_next = (elm); \ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ (elm)->field.tqe_next = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_REMOVE(head, elm, field) do { \ if (((elm)->field.tqe_next) != NULL) \ (elm)->field.tqe_next->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ } while (0) #define TAILQ_REPLACE(head, elm, elm2, field) do { \ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \ (elm2)->field.tqe_next->field.tqe_prev = \ &(elm2)->field.tqe_next; \ else \ (head)->tqh_last = &(elm2)->field.tqe_next; \ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ *(elm2)->field.tqe_prev = (elm2); \ } while (0) /* * Circular queue definitions. */ #define CIRCLEQ_HEAD(name, type) \ struct name { \ struct type *cqh_first; /* first element */ \ struct type *cqh_last; /* last element */ \ } #define CIRCLEQ_HEAD_INITIALIZER(head) \ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) } #define CIRCLEQ_ENTRY(type) \ struct { \ struct type *cqe_next; /* next element */ \ struct type *cqe_prev; /* previous element */ \ } /* * Circular queue access methods */ #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) #define CIRCLEQ_END(head) ((void *)(head)) #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) #define CIRCLEQ_EMPTY(head) \ (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head)) #define CIRCLEQ_FOREACH(var, head, field) \ for((var) = CIRCLEQ_FIRST(head); \ (var) != CIRCLEQ_END(head); \ (var) = CIRCLEQ_NEXT(var, field)) #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ for((var) = CIRCLEQ_LAST(head); \ (var) != CIRCLEQ_END(head); \ (var) = CIRCLEQ_PREV(var, field)) /* * Circular queue functions. */ #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = CIRCLEQ_END(head); \ (head)->cqh_last = CIRCLEQ_END(head); \ } while (0) #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ (elm)->field.cqe_prev = (listelm); \ if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm); \ else \ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ (listelm)->field.cqe_next = (elm); \ } while (0) #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm); \ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm); \ else \ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ (listelm)->field.cqe_prev = (elm); \ } while (0) #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ (elm)->field.cqe_next = (head)->cqh_first; \ (elm)->field.cqe_prev = CIRCLEQ_END(head); \ if ((head)->cqh_last == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm); \ else \ (head)->cqh_first->field.cqe_prev = (elm); \ (head)->cqh_first = (elm); \ } while (0) #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.cqe_next = CIRCLEQ_END(head); \ (elm)->field.cqe_prev = (head)->cqh_last; \ if ((head)->cqh_first == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm); \ else \ (head)->cqh_last->field.cqe_next = (elm); \ (head)->cqh_last = (elm); \ } while (0) #define CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ else \ (elm)->field.cqe_next->field.cqe_prev = \ (elm)->field.cqe_prev; \ if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \ (head)->cqh_first = (elm)->field.cqe_next; \ else \ (elm)->field.cqe_prev->field.cqe_next = \ (elm)->field.cqe_next; \ } while (0) #define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \ CIRCLEQ_END(head)) \ (head).cqh_last = (elm2); \ else \ (elm2)->field.cqe_next->field.cqe_prev = (elm2); \ if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \ CIRCLEQ_END(head)) \ (head).cqh_first = (elm2); \ else \ (elm2)->field.cqe_prev->field.cqe_next = (elm2); \ } while (0) #endif /* !_SYS_QUEUE_H_ */ libdnet-1.12/trunk/include/stamp-h.in0000644000076500007650000000001207640762604020721 0ustar dugsongdugsong00000000000000timestamp libdnet-1.12/trunk/INSTALL0000644000076500007650000000302410204323353016414 0ustar dugsongdugsong00000000000000 *BSD, MacOS X, Linux -------------------- ./configure && make Solaris, IRIX, BSD/OS, HP-UX, Tru64 ----------------------------------- For firewall support, install Darren Reed's IP Filter package: http://coombs.anu.edu.au/~avalon/ For tunnel support on Solaris, install the Universal TUN/TAP Driver: http://vtun.sourceforge.net/tun/ Unixware, AIX ------------- These ports are incomplete. If anyone can set me up with legitimate root access to these platforms, it would be most appreciated. :-) Windows 2000/XP --------------- For raw Ethernet sending, install the WinPcap driver and DLLs, and extract their developer pack to a build directory: http://winpcap.polito.it/install/default.htm # XXX - unsupported for now # For tunnel interface support, install the OpenVPN "TAP-Win32 Virtual # Ethernet Adapter" component (their Windows installer will let you # install it alone): # # http://openvpn.sourceforge.net/ For firewall support, install HSC's PktFilter service: http://www.hsc.fr/ressources/outils/pktfilter/index.html.en Most Windows developers should just use the libdnet developer's pack (with MinGW and MSVC++ libraries) instead of building it themselves. But for those who really want to know... To build a MinGW native library (under Cygwin+MinGW): ./configure && make To build a Microsoft Visual C++ native library and Python module (again, under Cygwin+MinGW): ./configure cd python && C:/Python23/python.exe setup.py build cd ../src && lib /out:dnet.lib *.obj # $Id: INSTALL 590 2005-02-15 07:38:19Z dugsong $ libdnet-1.12/trunk/libdnet.spec0000644000076500007650000000365310554377551017711 0ustar dugsongdugsong00000000000000# # Libdnet -- Simplified interface to low-level networking (RPM package spec) # # # Options: # --with gnuld Assume the C compiler uses GNU ld # (see --with-gnu-ld in ./configure) # %define name libdnet %define version 1.12 %define release 1 %define appname %{name}-%{version} %define rpmname %{name}-%{version}-%{release} %define buildname %{appname} Name: %{name} Version: %{version} Release: %{release} Summary: Simplified, portable interface to low-level networking routines Group: System Environment/Libraries Vendor: Dug Song URL: http://libdnet.sourceforge.net License: BSD Source: http://prdownloads.sourceforge.net/libdnet/%{appname}.tar.gz Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-root %description libdnet provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel Development files (Headers, libraries for static linking, etc) for %{name}. %prep rm -rf $RPM_BUILD_DIR/%{buildname} %setup -n %{buildname} %build %configure %{?_with_gnuld:--with-gnu-ld} make %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT rm $RPM_BUILD_ROOT/.%{_libdir}/*.la %clean rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_DIR/%{buildname} %post -p /sbin/ldconfig %preun -p /sbin/ldconfign %files %defattr(-,root,root) %{_sbindir} %{_libdir}/*.so.* %{_mandir}/man8 %files devel %defattr(-,root,root) %{_bindir} %{_includedir} %{_libdir}/*.a %{_libdir}/*.so %{_mandir}/man3 %doc README %doc TODO %changelog * Wed Jun 1 2004 nnposter at users,sourceforge,net - Created 1.8-1 RPM spec # vim:ts=4: libdnet-1.12/trunk/LICENSE0000644000076500007650000000266710554372471016421 0ustar dugsongdugsong00000000000000 Copyright (c) 2000-2006 Dug Song All rights reserved, all wrongs reversed. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors and copyright holders may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libdnet-1.12/trunk/Makefile.am0000644000076500007650000000071110362367313017430 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 618 2006-01-15 06:42:19Z dugsong $ include $(top_srcdir)/Makefile.am.common SUBDIRS = include man src python test bin_SCRIPTS = dnet-config EXTRA_DIST = LICENSE Makefile.am.common acconfig.h CLEANFILES = dnet-config AUX_DIST = $(ac_aux_dir)/acinclude.m4 \ $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub \ $(ac_aux_dir)/install-sh \ $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs libdnet-1.12/trunk/Makefile.am.common0000644000076500007650000000022210363626427020721 0ustar dugsongdugsong00000000000000## $Id: Makefile.am.common 623 2006-01-19 06:09:27Z dugsong $ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include libdnet-1.12/trunk/Makefile.in0000644000076500007650000003516410363627052017453 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include SUBDIRS = include man src python test bin_SCRIPTS = dnet-config EXTRA_DIST = LICENSE Makefile.am.common acconfig.h CLEANFILES = dnet-config AUX_DIST = $(ac_aux_dir)/acinclude.m4 \ $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub \ $(ac_aux_dir)/install-sh \ $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = dnet-config SCRIPTS = $(bin_SCRIPTS) depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README INSTALL Makefile.am Makefile.in THANKS TODO \ acconfig.h aclocal.m4 config/acinclude.m4 config/config.guess \ config/config.sub config/install-sh config/ltmain.sh \ config/missing config/mkinstalldirs configure configure.in \ dnet-config.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) dnet-config: $(top_builddir)/config.status dnet-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ binSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. $(distdir)/config $(distdir)/python @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ exit 1; } >&2 ) \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' 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 after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-binSCRIPTS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-binSCRIPTS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive dist dist-all \ dist-gzip distcheck distclean distclean-generic \ distclean-libtool distclean-recursive distclean-tags \ distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-binSCRIPTS \ install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-info install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/trunk/man/0000755000076500007650000000000010554406444016152 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/man/dnet.30000644000076500007650000004655110207726670017204 0ustar dugsongdugsong00000000000000.\" .\" Copyright (c) 2000 Dug Song .\" .\" $Id: dnet.3 604 2005-02-25 22:59:04Z dugsong $ .\" .Dd August 21, 2001 .Dt DNET 3 .Os .Sh NAME .Nm dnet .Nd dumb networking library .Sh SYNOPSIS .Fd #include .Ss Network addressing .Ft int .Fn addr_cmp "const struct addr *a" "const struct addr *b" .Ft int .Fn addr_bcast "const struct addr *a" "struct addr *b" .Ft int .Fn addr_net "const struct addr *a" "struct addr *b" .Ft char * .Fn addr_ntop "const struct addr *src" "char *dst" "size_t size" .Ft int .Fn addr_pton "const char *src" "struct addr *dst" .Ft char * .Fn addr_ntoa "const struct addr *a" .Ft int .Fn addr_aton "const char *src" "struct addr *dst" .Ft int .Fn addr_ntos "const struct addr *a" "struct sockaddr *sa" .Ft int .Fn addr_ston "const struct sockaddr *sa" "struct addr *a" .Ft int .Fn addr_btos "uint16_t bits" "struct sockaddr *sa" .Ft int .Fn addr_stob "const struct sockaddr *sa" "uint16_t *bits" .Ft int .Fn addr_btom "uint16_t bits" "void *mask" "size_t size" .Ft int .Fn addr_mtob "const void *mask" "size_t size" "uint16_t *bits" .Ss Address Resolution Protocol .Pp .Li typedef Ar int Fn (*arp_handler) "const struct arp_entry *entry" "void *arg" .Ft arp_t * .Fn arp_open "void" .Ft int .Fn arp_add "arp_t *a" "const struct arp_entry *entry" .Ft int .Fn arp_delete "arp_t *a" "const struct arp_entry *entry" .Ft int .Fn arp_get "arp_t *a" "struct arp_entry *entry" .Ft int .Fn arp_loop "arp_t *a" "arp_handler callback" "void *arg" .Ft arp_t * .Fn arp_close "arp_t *a" .Ss Binary buffers .Ft blob_t * .Fn blob_new "void" .Ft int .Fn blob_read "blob_t *b" "void *buf" "int len" .Ft int .Fn blob_write "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_seek "blob_t *b" "int off" "int whence" .Ft int .Fn blob_index "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_rindex "blob_t *b" "const void *buf" "int len" .Ft int .Fn blob_pack "blob_t *b" "const void *fmt" "..." .Ft int .Fn blob_unpack "blob_t *b" "const void *fmt" "..." .Ft int .Fn blob_print "blob_t *b" "char *style" "int len" .Ft blob_t * .Fn blob_free "blob_t *b" .Ss Ethernet .Ft eth_t * .Fn eth_open "const char *device" .Ft int .Fn eth_get "eth_t *e" "eth_addr_t *ea" .Ft int .Fn eth_set "eth_t *e" "const eth_addr_t *ea" .Ft ssize_t .Fn eth_send "eth_t *e" "const void *buf" "size_t len" .Ft eth_t * .Fn eth_close "eth_t *e" .Ss Firewalling .Pp .Li typedef Ar int Fn (*fw_handler) "const struct fw_rule *rule" "void *arg" .Ft fw_t * .Fn fw_open "void" .Ft int .Fn fw_add "fw_t *f" "const struct fw_rule *rule" .Ft int .Fn fw_delete "fw_t *f" "const struct fw_rule *rule" .Ft int .Fn fw_loop "fw_t *f" "fw_handler callback" "void *arg" .Ft fw_t * .Fn fw_close "fw_t *f" .Ss Network interfaces .Pp .Li typedef Ar int Fn (*intf_handler) "const struct intf_entry *entry" "void *arg" .Ft intf_t * .Fn intf_open "void" .Ft int .Fn intf_get "intf_t *i" "struct intf_entry *entry" .Ft int .Fn intf_get_src "intf_t *i" "struct intf_entry *entry" "struct addr *src" .Ft int .Fn intf_get_dst "intf_t *i" "struct intf_entry *entry" "struct addr *dst" .Ft int .Fn intf_set "intf_t *i" "const struct intf_entry *entry" .Ft int .Fn intf_loop "intf_t *i" "intf_handler callback" "void *arg" .Ft intf_t * .Fn intf_close "intf_t *i" .Ss Internet Protocol .Ft ip_t * .Fn ip_open "void" .Ft ssize_t .Fn ip_add_option "void *buf" "size_t len" "int proto" "const void *optbuf" "size_t optlen" .Ft void .Fn ip_checksum "void *buf" "size_t len" .Ft ssize_t .Fn ip_send "ip_t *i" "const void *buf" "size_t len" .Ft ip_t * .Fn ip_close "ip_t *i" .Ss Internet Protocol Version 6 .Ft void .Fn ip6_checksum "void *buf" "size_t len" .Ss Random number generation .Pp .Ft rand_t * .Fn rand_open "void" .Ft int .Fn rand_get "rand_t *r" "void *buf" "size_t len" .Ft int .Fn rand_set "rand_t *r" "const void *seed" "size_t len" .Ft int .Fn rand_add "rand_t *r" "const void *buf" "size_t len" .Ft uint8_t .Fn rand_uint8 "rand_t *r" .Ft uint16_t .Fn rand_uint16 "rand_t *r" .Ft uint32_t .Fn rand_uint32 "rand_t *r" .Ft int .Fn rand_shuffle "rand_t *r" "void *base" "size_t nmemb" "size_t size" .Ft rand_t * .Fn rand_close "rand_t *r" .Ss Routing .Pp .Li typedef Ar int Fn (*route_handler) "const struct route_entry *entry" "void *arg" .Ft route_t * .Fn route_open "void" .Ft int .Fn route_add "route_t *r" "const struct route_entry *entry" .Ft int .Fn route_delete "route_t *r" "const struct route_entry *entry" .Ft int .Fn route_get "route_t *r" "struct route_entry *entry" .Ft int .Fn route_loop "route_t *r" "route_handler callback" "void *arg" .Ft route_t * .Fn route_close "route_t *r" .Ss Tunnel interface .Pp .Ft tun_t * .Fn tun_open "struct addr *src" "struct addr *dst" "int mtu" .Ft int .Fn tun_fileno "tun_t *t" .Ft const char * .Fn tun_name "tun_t *t" .Ft ssize_t .Fn tun_send "tun_t *t" "const void *buf" "size_t size" .Ft ssize_t .Fn tun_recv "tun_t *t" "void *buf" "size_t size" .Ft tun_t * .Fn tun_close "tun_t *t" .Pp .Sh DESCRIPTION .Nm provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel .Xr arp 4 cache and .Xr route 4 table lookup and manipulation, network firewalling, network interface lookup and manipulation, and raw IP packet and Ethernet frame transmission. It is intended to complement the functionality provided by .Xr pcap 3 . .Pp In addition, .Nm also provides platform-independent definitions of various network protocol formats and values for portable low-level network programming, as well as a simple binary buffer handling API. .Pp .Ss Network addressing Network addresses are described by the following structure: .Bd -literal struct addr { uint16_t addr_type; uint16_t addr_bits; union { eth_addr_t __eth; ip_addr_t __ip; ip6_addr_t __ip6; uint8_t __data8[16]; uint16_t __data16[8]; uint32_t __data32[4]; } __addr_u; }; #define addr_eth __addr_u.__eth #define addr_ip __addr_u.__ip #define addr_ip6 __addr_u.__ip6 #define addr_data8 __addr_u.__data8 #define addr_data16 __addr_u.__data16 #define addr_data32 __addr_u.__data32 .Ed .Pp The following values are defined for .Ar addr_type : .Bd -literal #define ADDR_TYPE_NONE 0 /* No address set */ #define ADDR_TYPE_ETH 1 /* Ethernet */ #define ADDR_TYPE_IP 2 /* Internet Protocol v4 */ #define ADDR_TYPE_IP6 3 /* Internet Protocol v6 */ .Ed .Pp The field .Ar addr_bits denotes the length of the network mask in bits. .Pp .Fn addr_cmp compares network addresses .Fa a and .Fa b , returning an integer less than, equal to, or greater than zero if .Fa a is found, respectively, to be less than, equal to, or greater than .Fa b . Both addresses must be of the same address type. .Pp .Fn addr_bcast computes the broadcast address for the network specified in .Fa a and writes it into .Fa b . .Pp .Fn addr_net computes the network address for the network specified in .Fa a and writes it into .Fa b . .Pp .Fn addr_ntop converts an address from network format to a string. .Pp .Fn addr_pton converts an address (or hostname) from a string to network format. .Pp .Fn addr_ntoa converts an address from network format to a string, returning a pointer to the result in static memory. .Pp .Fn addr_aton is a synonym for .Fn addr_pton . .Pp .Fn addr_ntos converts an address from network format to the appropriate struct sockaddr. .Pp .Fn addr_ston converts an address from a struct sockaddr to network format. .Pp .Fn addr_btos converts a network mask length to a network mask specified as a struct sockaddr. .Pp .Fn addr_stob converts a network mask specified in a struct sockaddr to a network mask length. .Pp .Fn addr_btom converts a network mask length to a network mask in network byte order. .Pp .Fn addr_mtob converts a network mask in network byte order to a network mask length. .Ss Address Resolution Protocol ARP cache entries are described by the following structure: .Bd -literal struct arp_entry { struct addr arp_pa; /* protocol address */ struct addr arp_ha; /* hardware address */ }; .Ed .Pp .Fn arp_open is used to obtain a handle to access the kernel .Xr arp 4 cache. .Pp .Fn arp_add adds a new ARP .Fa entry . .Pp .Fn arp_delete deletes the ARP .Fa entry for the protocol address specified by .Fa arp_pa . .Pp .Fn arp_get retrieves the ARP .Fa entry for the protocol address specified by .Fa arp_pa . .Pp .Fn arp_loop iterates over the kernel .Xr arp 4 cache, invoking the specified .Fa callback with each .Fa entry and the context .Fa arg passed to .Fn arp_loop . .Pp .Fn arp_close closes the specified handle. .Pp .Ss Binary buffers Binary buffers are described by the following structure: .Bd -literal typedef struct blob { u_char *base; /* start of data */ int off; /* offset into data */ int end; /* end of data */ int size; /* size of allocation */ } blob_t; .Ed .Pp .Fn blob_new is used to allocate a new dynamic binary buffer, returning NULL on failure. .Pp .Fn blob_read reads .Fa len bytes from the current offset in blob .Fa b into .Fa buf , returning the total number of bytes read, or -1 on failure. .Pp .Fn blob_write writes .Fa len bytes from .Fa buf to blob .Fa b , advancing the current offset. It returns the number of bytes written, or -1 on failure. .Pp .Fn blob_seek repositions the offset within blob .Fa b to .Fa off , according to the directive .Fa whence (see .Xr lseek 2 for details), returning the new absolute offset, or -1 on failure. .Pp .Fn blob_index returns the offset of the first occurence in blob .Fa b of the specified .Fa buf of length .Fa len , or -1 on failure. .Pp .Fn blob_rindex returns the offset of the last occurence in blob .Fa b of the specified .Fa buf of length .Fa len , or -1 on failure. .Pp .Fn blob_pack converts and writes, and .Fn blob_unpack reads and converts data in blob .Fa b according to the given format .Fa fmt as described below, returning 0 on success, and -1 on failure. .Pp The format string is composed of zero or more directives: ordinary characters (not .Cm % ), which are copied to / read from the blob, and conversion specifications, each of which results in reading / writing zero or more subsequent arguments. .Pp Each conversion specification is introduced by the character .Cm % , and may be prefixed by length specifier. The arguments must correspond properly (after type promotion) with the length and conversion specifiers. .Pp The length specifier is either a a decimal digit string specifying the length of the following argument, or the literal character .Cm * indicating that the length should be read from an integer argument for the argument following it. .Pp The conversion specifiers and their meanings are: .Bl -tag -width indent .It Cm D An unsigned 32-bit integer in network byte order. .It Cm H An unsigned 16-bit integer in network byte order. .It Cm b A binary buffer (length specifier required). .It Cm c An unsigned character. .It Cm d An unsigned 32-bit integer in host byte order. .It Cm h An unsigned 16-bit integer in host byte order. .It Cm s A C-style null-terminated string, whose maximum length must be specified when unpacking. .El .Pp Custom conversion routines and their specifiers may be registered via .Fn blob_register_pack , currently undocumented. .Pp .Fn blob_print prints .Fa len bytes of the contents of blob .Fa b from the current offset in the specified .Fa style ; currently only .Dq hexl is available. .Pp .Fn blob_free deallocates the memory associated with blob .Fa b and returns NULL. .Pp .Ss Ethernet .Fn eth_open is used to obtain a handle to transmit raw Ethernet frames via the specified network .Fa device . .Pp .Fn eth_get retrieves the hardware MAC address for the interface specified by .Ar e . .Pp .Fn eth_set configures the hardware MAC address for the interface specified by .Ar e . .Pp .Fn eth_send transmits .Fa len bytes of the Ethernet frame pointed to by .Fa buf . .Pp .Fn eth_close closes the specified handle. .Pp .Ss Firewalling Firewall rules are described by the following structure: .Bd -literal struct fw_rule { char fw_device[INTF_NAME_LEN]; /* interface name */ uint8_t fw_op; /* operation */ uint8_t fw_dir; /* direction */ uint8_t fw_proto; /* IP protocol */ struct addr fw_src; /* src address / net */ struct addr fw_dst; /* dst address / net */ uint16_t fw_sport[2]; /* range / ICMP type */ uint16_t fw_dport[2]; /* range / ICMP code */ }; .Ed .Pp The following values are defined for .Ar fw_op : .Bd -literal #define FW_OP_ALLOW 1 #define FW_OP_BLOCK 2 .Ed .Pp The following values are defined for .Ar fw_dir : .Bd -literal #define FW_DIR_IN 1 #define FW_DIR_OUT 2 .Ed .Pp .Fn fw_open is used to obtain a handle to access the local network firewall configuration. .Pp .Fn fw_add adds the specified firewall .Fa rule . .Pp .Fn fw_delete deletes the specified firewall .Fa rule . .Pp .Fn fw_loop iterates over the active firewall ruleset, invoking the specified .Fa callback with each .Fa rule and the context .Fa arg passed to .Fn fw_loop . .Pp .Fn fw_close closes the specified handle. .Pp .Ss Network interfaces Network interface information is described by the following structure: .Bd -literal #define INTF_NAME_LEN 16 struct intf_entry { u_int intf_len; /* length of entry */ char intf_name[INTF_NAME_LEN]; /* interface name */ u_short intf_type; /* interface type (r/o) */ u_short intf_flags; /* interface flags */ u_int intf_mtu; /* interface MTU */ struct addr intf_addr; /* interface address */ struct addr intf_dst_addr; /* point-to-point dst */ struct addr intf_link_addr; /* link-layer address */ u_int intf_alias_num; /* number of aliases */ struct addr intf_alias_addrs __flexarr; /* array of aliases */ }; .Ed .Pp The following bitmask values are defined for .Ar intf_type : .Bd -literal #define INTF_TYPE_OTHER 1 /* other */ #define INTF_TYPE_ETH 6 /* Ethernet */ #define INTF_TYPE_LOOPBACK 24 /* software loopback */ #define INTF_TYPE_TUN 53 /* proprietary virtual/internal */ .Ed .Pp The following bitmask values are defined for .Ar intf_flags : .Bd -literal #define INTF_FLAG_UP 0x01 /* enable interface */ #define INTF_FLAG_LOOPBACK 0x02 /* is a loopback net (r/o) */ #define INTF_FLAG_POINTOPOINT 0x04 /* point-to-point link (r/o) */ #define INTF_FLAG_NOARP 0x08 /* disable ARP */ #define INTF_FLAG_BROADCAST 0x10 /* supports broadcast (r/o) */ #define INTF_FLAG_MULTICAST 0x20 /* supports multicast (r/o) */ .Ed .Pp .Fn intf_open is used to obtain a handle to access the network interface configuration. .Pp .Fn intf_get retrieves an interface configuration .Fa entry , keyed on .Fa intf_name . For all .Fn intf_get functions, .Fa intf_len should be set to the size of the buffer pointed to by .Fa entry (usually sizeof(struct intf_entry), but should be larger to accomodate any interface alias addresses. .Pp .Fn intf_get_src retrieves the configuration for the interface whose primary address matches the specified .Fa src . .Pp .Fn intf_get_dst retrieves the configuration for the best interface with which to reach the specified .Fa dst . .Pp .Fn intf_set sets the interface configuration .Fa entry . .Pp .Fn intf_loop iterates over all network interfaces, invoking the specified .Fa callback with each interface configuration .Fa entry and the context .Fa arg passed to .Fn intf_loop . .Pp .Fn intf_close closes the specified handle. .Pp .Ss Internet Protocol .Fn ip_open is used to obtain a handle to transmit raw IP packets, routed by the kernel. .Pp .Fn ip_add_option adds the header option for the protocol .Fa proto specified by .Fa optbuf of length .Fa optlen and appends it to the appropriate header of the IP packet contained in .Fa buf of size .Fa len , shifting any existing payload and adding NOPs to pad the option to a word boundary if necessary. .Pp .Fn ip_checksum sets the IP checksum and any appropriate transport protocol checksum for the IP packet pointed to by .Fa buf of length .Fa len . .Pp .Fn ip_send transmits .Fa len bytes of the IP packet pointed to by .Fa buf . .Pp .Fn ip_close closes the specified handle. .Pp .Ss Internet Protocol Version 6 .Fn ip6_checksum sets the appropriate transport protocol checksum for the IPv6 packet pointed to by .Fa buf of length .Fa len . .Pp .Ss Random number generation .Fn rand_open is used to obtain a handle for fast, cryptographically strong pseudo-random number generation. The starting seed is derived from the system random data source device (if one exists), or from the current time and random stack contents. .Pp .Fn rand_set re-initializes the PRNG to start from a known .Fa seed value, useful in generating repeatable sequences. .Pp .Fn rand_get writes .Fa len random bytes into .Fa buf . .Pp .Fn rand_add adds .Fa len bytes of entropy data from .Fa buf into the random mix. .Pp .Fn rand_uint8 , .Fn rand_uint16 , and .Fn rand_uint32 return 8, 16, and 32-bit unsigned random values, respectively. .Pp .Fn rand_shuffle randomly shuffles an array of .Fa nmemb elements of .Fa size bytes, starting at .Fa base . .Pp .Fn rand_close closes the specified handle. .Pp .Ss Routing Routing table entries are described by the following structure: .Bd -literal struct route_entry { struct addr route_dst; /* destination address */ struct addr route_gw; /* gateway address */ }; .Ed .Pp .Fn route_open is used to obtain a handle to access the kernel .Xr route 4 table. .Pp .Fn route_add adds a new routing table .Fa entry . .Pp .Fn route_delete deletes the routing table .Fa entry for the destination prefix specified by .Fa route_dst . .Pp .Fn route_get retrieves the routing table .Fa entry for the destination prefix specified by .Fa route_dst . .Pp .Fn route_loop iterates over the kernel .Xr route 4 table, invoking the specified .Fa callback with each .Fa entry and the context .Fa arg passed to .Fn route_loop . .Pp .Fn route_close closes the specified handle. .Pp .Ss Tunnel interface .Fn tun_open is used to obtain a handle to a network tunnel interface, to which IP packets destined for .Fa dst are delivered (with source addresses rewritten to .Fa src ), where they may be read by a userland process and processed as desired. IP packets written back to the handle are injected into the kernel networking subsystem. .Pp .Fn tun_fileno returns a file descriptor associated with the tunnel handle, suitable for .Xr select 2 . .Pp .Fn tun_name returns a pointer to the tunnel interface name. .Pp .Fn tun_send submits a packet to the kernel networking subsystem for delivery. .Pp .Fn tun_recv reads the next packet delivered to the tunnel interface. .Pp .Fn tun_close closes the specified handle. .Pp .Sh RETURN VALUES .Fn addr_ntop returns a pointer to the .Fa dst argument, or NULL on failure. .Pp .Fn addr_ntoa returns a pointer to a static memory area containing the printable address, or NULL on failure. .Pp .Fn arp_open , .Fn eth_open , .Fn fw_open , .Fn intf_open , .Fn ip_open , .Fn rand_open , and .Fn route_open return a valid handle on success, or NULL on failure. .Pp .Fn arp_close , .Fn eth_close , .Fn fw_close , .Fn intf_close , .Fn ip_close , .Fn rand_close , and .Fn route_close always return NULL. .Pp .Fn eth_send and .Fn ip_send return the length of the datagram successfully sent, or -1 on failure. .Pp .Fn arp_loop , .Fn fw_loop , .Fn intf_loop , and .Fn route_loop return the status of their .Fa callback routines. Any non-zero return from a .Fa callback will cause the loop to exit immediately. .Pp .Fn ip_add_option returns the length of the inserted option (which may have been padded with NOPs for memory alignment) or -1 on failure. .Pp .Fn rand_uint8 , .Fn rand_uint16 , and .Fn rand_uint32 return 8, 16, and 32-bit unsigned random values, respectively. .Pp All other .Nm routines return 0 on success, or -1 on failure. .Sh SEE ALSO .Xr pcap 3 .Sh AUTHORS Dug Song .Aq dugsong@monkey.org libdnet-1.12/trunk/man/Makefile.am0000644000076500007650000000032307361230050020172 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 11 2001-10-11 05:37:44Z dugsong $ include $(top_srcdir)/Makefile.am.common man_MANS = dnet.3 EXTRA_DIST = $(man_MANS) dnet.3.txt: dnet.3 groff -t -e -mdoc -Tascii dnet.3 | col -bx > $@ libdnet-1.12/trunk/man/Makefile.in0000644000076500007650000001700010363627052020213 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include man_MANS = dnet.3 EXTRA_DIST = $(man_MANS) subdir = man mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign man/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: man3dir = $(mandir)/man3 install-man3: $(man3_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man3dir) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 3*) ;; \ *) ext='3' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \ done uninstall-man3: @$(NORMAL_UNINSTALL) @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.3*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \ rm -f $(DESTDIR)$(man3dir)/$$inst; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(man3dir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man3 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man3 .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-man3 install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am \ uninstall-man uninstall-man3 dnet.3.txt: dnet.3 groff -t -e -mdoc -Tascii dnet.3 | col -bx > $@ # 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: libdnet-1.12/trunk/python/0000755000076500007650000000000010554406421016713 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/python/dnet.c0000644000076500007650000135714010554377612020035 0ustar dugsongdugsong00000000000000/* Generated by Pyrex 0.9.4.1 on Sat Jan 20 06:39:10 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif __PYX_EXTERN_C double pow(double, double); #include "dnet.h" typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/ typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t); /*proto*/ static int __Pyx_EndUnpack(PyObject *, Py_ssize_t); /*proto*/ static int __Pyx_PrintItem(PyObject *); /*proto*/ static int __Pyx_PrintNewline(void); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static void __Pyx_ReRaise(void); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetExcValue(void); /*proto*/ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2); /*proto*/ static void __Pyx_WriteUnraisable(char *name); /*proto*/ static void __Pyx_AddTraceback(char *funcname); /*proto*/ static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ static int __Pyx_InitCApi(PyObject *module); /*proto*/ static int __Pyx_ImportModuleCApi(__Pyx_CApiTabEntry *t); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static PyObject *__pyx_m; static PyObject *__pyx_b; static int __pyx_lineno; static char *__pyx_filename; static char **__pyx_f; static char __pyx_mdoc[] = "dumb networking library\n\nThis module provides a simplified interface to several low-level\nnetworking routines, including network address manipulation, kernel\narp(4) cache and route(4) table lookup and manipulation, network\nfirewalling, network interface lookup and manipulation, IP tunnelling,\nand raw IP packet and Ethernet frame transmission.\n"; /* Declarations from dnet */ enum { __pyx_e_4dnet_TEADELTA = 2654435769, __pyx_e_4dnet_TEAROUNDS = 32, __pyx_e_4dnet_TEASBOXSIZE = 128, __pyx_e_4dnet_TEASBOXSHIFT = 7, }; struct __pyx_obj_4dnet_eth { PyObject_HEAD eth_t (*eth); }; struct __pyx_obj_4dnet_ip { PyObject_HEAD ip_t (*ip); }; struct __pyx_obj_4dnet_addr { PyObject_HEAD struct addr _addr; }; struct __pyx_obj_4dnet___addr_ip4_iter { PyObject_HEAD unsigned long cur; unsigned long max; }; struct __pyx_obj_4dnet_arp { PyObject_HEAD arp_t (*arp); }; struct __pyx_obj_4dnet_intf { PyObject_HEAD intf_t (*intf); }; struct __pyx_obj_4dnet_route { PyObject_HEAD route_t (*route); }; struct __pyx_obj_4dnet_fw { PyObject_HEAD fw_t (*fw); }; struct __pyx_obj_4dnet_rand { PyObject_HEAD rand_t (*rand); }; struct __pyx_obj_4dnet___rand_xrange { PyObject_HEAD rand_t (*rand); unsigned long cur; unsigned long enc; unsigned long max; unsigned long mask; unsigned long start; unsigned long sboxmask; unsigned int (sbox[128]); int left; int right; int kshift; }; struct __pyx_obj_4dnet_tun { PyObject_HEAD tun_t (*tun); char (*buf); int mtu; }; static PyTypeObject *__pyx_ptype_4dnet_eth = 0; static PyTypeObject *__pyx_ptype_4dnet_ip = 0; static PyTypeObject *__pyx_ptype_4dnet_addr = 0; static PyTypeObject *__pyx_ptype_4dnet___addr_ip4_iter = 0; static PyTypeObject *__pyx_ptype_4dnet_arp = 0; static PyTypeObject *__pyx_ptype_4dnet_intf = 0; static PyTypeObject *__pyx_ptype_4dnet_route = 0; static PyTypeObject *__pyx_ptype_4dnet_fw = 0; static PyTypeObject *__pyx_ptype_4dnet_rand = 0; static PyTypeObject *__pyx_ptype_4dnet___rand_xrange = 0; static PyTypeObject *__pyx_ptype_4dnet_tun = 0; static PyObject *__pyx_k16; static PyObject *__pyx_k17; static PyObject *__pyx_k18; static PyObject *__pyx_k24; static PyObject *__pyx_k25; static PyObject *__pyx_k26; static PyObject *__pyx_k27; static PyObject *__pyx_k28; static PyObject *__pyx_k29; static PyObject *__pyx_k30; static PyObject *__pyx_k31; static PyObject *__pyx_k34; static PyObject *__pyx_k35; static PyObject *__pyx_k36; static PyObject *__pyx_k37; static PyObject *__pyx_k38; static PyObject *__pyx_k39; static PyObject *__pyx_k40; static PyObject *__pyx_k41; static PyObject *__pyx_k42; static PyObject *__pyx_k43; static PyObject *__pyx_k44; static PyObject *__pyx_k45; static PyObject *__pyx_k46; static PyObject *__pyx_k47; static PyObject *__pyx_k48; static PyObject *__pyx_k49; static PyObject *__pyx_k50; static PyObject *__pyx_k51; static PyObject *__pyx_k52; static PyObject *__pyx_k53; static PyObject *__pyx_k54; static PyObject *__pyx_k55; static PyObject *__pyx_k56; static PyObject *__pyx_k57; static PyObject *__pyx_k58; static PyObject *__pyx_k59; static PyObject *(__pyx_f_4dnet___memcpy(char (*),PyObject *,int )); /*proto*/ static PyObject *(__pyx_f_4dnet___oserror(void)); /*proto*/ static int (__pyx_f_4dnet___arp_callback(struct arp_entry (*),void (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_ifent_to_dict(struct intf_entry (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_dict_to_ifent(PyObject *,struct intf_entry (*))); /*proto*/ static int (__pyx_f_4dnet___intf_callback(struct intf_entry (*),void (*))); /*proto*/ static int (__pyx_f_4dnet___route_callback(struct route_entry (*),void (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_rule_to_dict(struct fw_rule (*))); /*proto*/ static PyObject *(__pyx_f_4dnet_dict_to_rule(PyObject *,struct fw_rule (*))); /*proto*/ static int (__pyx_f_4dnet___fw_callback(struct fw_rule (*),void (*))); /*proto*/ /* Implementation of dnet */ static char (__pyx_k1[]) = "Address type (ADDR_TYPE_*) integer."; static char (__pyx_k2[]) = "Address bitlength integer."; static char (__pyx_k3[]) = "Raw address string."; static char (__pyx_k4[]) = "Ethernet MAC address as binary string."; static char (__pyx_k5[]) = "IPv4 address as binary string."; static char (__pyx_k6[]) = "IPv6 address as binary string."; static char (__pyx_k7[]) = "Tunnel interface name."; static char (__pyx_k8[]) = "File descriptor for tunnel handle."; static char (__pyx_k9[]) = "Dug Song "; static char (__pyx_k10[]) = "Copyright (c) 2003 Dug Song"; static char (__pyx_k12[]) = "http://libdnet.sourceforge.net/"; static char (__pyx_k13[]) = "1.12"; static char (__pyx_k14[]) = "\x000\x000\x000\x000\x000\x000"; static char (__pyx_k15[]) = "\x0ff\x0ff\x0ff\x0ff\x0ff\x0ff"; static char (__pyx_k19[]) = "\x000\x000\x000\x000"; static char (__pyx_k20[]) = "\x0ff\x0ff\x0ff\x0ff"; static char (__pyx_k21[]) = "\x07f\x000\x000\x001"; static char (__pyx_k22[]) = "\x0e0\x000\x000\x001"; static char (__pyx_k23[]) = "\x0e0\x000\x000\x0ff"; static char (__pyx_k32[]) = "\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000"; static char (__pyx_k33[]) = "\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001"; static PyObject *__pyx_n___author__; static PyObject *__pyx_n___copyright__; static PyObject *__pyx_n___license__; static PyObject *__pyx_n___url__; static PyObject *__pyx_n___version__; static PyObject *__pyx_n___iter_append; static PyObject *__pyx_n_ETH_ADDR_LEN; static PyObject *__pyx_n_ETH_ADDR_BITS; static PyObject *__pyx_n_ETH_TYPE_LEN; static PyObject *__pyx_n_ETH_CRC_LEN; static PyObject *__pyx_n_ETH_HDR_LEN; static PyObject *__pyx_n_ETH_LEN_MIN; static PyObject *__pyx_n_ETH_LEN_MAX; static PyObject *__pyx_n_ETH_MTU; static PyObject *__pyx_n_ETH_MIN; static PyObject *__pyx_n_ETH_TYPE_PUP; static PyObject *__pyx_n_ETH_TYPE_IP; static PyObject *__pyx_n_ETH_TYPE_ARP; static PyObject *__pyx_n_ETH_TYPE_REVARP; static PyObject *__pyx_n_ETH_TYPE_8021Q; static PyObject *__pyx_n_ETH_TYPE_IPV6; static PyObject *__pyx_n_ETH_TYPE_MPLS; static PyObject *__pyx_n_ETH_TYPE_MPLS_MCAST; static PyObject *__pyx_n_ETH_TYPE_PPPOEDISC; static PyObject *__pyx_n_ETH_TYPE_PPPOE; static PyObject *__pyx_n_ETH_TYPE_LOOPBACK; static PyObject *__pyx_n_ETH_ADDR_UNSPEC; static PyObject *__pyx_n_ETH_ADDR_BROADCAST; static PyObject *__pyx_n_eth_ntoa; static PyObject *__pyx_n_eth_aton; static PyObject *__pyx_n_eth_pack_hdr; static PyObject *__pyx_n_IP_ADDR_LEN; static PyObject *__pyx_n_IP_ADDR_BITS; static PyObject *__pyx_n_IP_HDR_LEN; static PyObject *__pyx_n_IP_OPT_LEN; static PyObject *__pyx_n_IP_OPT_LEN_MAX; static PyObject *__pyx_n_IP_HDR_LEN_MAX; static PyObject *__pyx_n_IP_LEN_MAX; static PyObject *__pyx_n_IP_LEN_MIN; static PyObject *__pyx_n_IP_TOS_DEFAULT; static PyObject *__pyx_n_IP_RF; static PyObject *__pyx_n_IP_DF; static PyObject *__pyx_n_IP_MF; static PyObject *__pyx_n_IP_OFFMASK; static PyObject *__pyx_n_IP_TTL_DEFAULT; static PyObject *__pyx_n_IP_TTL_MAX; static PyObject *__pyx_n_IP_PROTO_IP; static PyObject *__pyx_n_IP_PROTO_ICMP; static PyObject *__pyx_n_IP_PROTO_IGMP; static PyObject *__pyx_n_IP_PROTO_TCP; static PyObject *__pyx_n_IP_PROTO_UDP; static PyObject *__pyx_n_IP_PROTO_IPV6; static PyObject *__pyx_n_IP_PROTO_GRE; static PyObject *__pyx_n_IP_PROTO_ESP; static PyObject *__pyx_n_IP_PROTO_AH; static PyObject *__pyx_n_IP_PROTO_ICMPV6; static PyObject *__pyx_n_IP_PROTO_RAW; static PyObject *__pyx_n_IP_PROTO_RESERVED; static PyObject *__pyx_n_IP_PROTO_MAX; static PyObject *__pyx_n_IP_ADDR_ANY; static PyObject *__pyx_n_IP_ADDR_BROADCAST; static PyObject *__pyx_n_IP_ADDR_LOOPBACK; static PyObject *__pyx_n_IP_ADDR_MCAST_ALL; static PyObject *__pyx_n_IP_ADDR_MCAST_LOCAL; static PyObject *__pyx_n_ip_ntoa; static PyObject *__pyx_n_ip_aton; static PyObject *__pyx_n_ip_checksum; static PyObject *__pyx_n_ip_cksum_add; static PyObject *__pyx_n_ip_cksum_carry; static PyObject *__pyx_n_ip_pack_hdr; static PyObject *__pyx_n_IP6_ADDR_LEN; static PyObject *__pyx_n_IP6_ADDR_BITS; static PyObject *__pyx_n_IP6_HDR_LEN; static PyObject *__pyx_n_IP6_LEN_MIN; static PyObject *__pyx_n_IP6_LEN_MAX; static PyObject *__pyx_n_IP6_MTU_MIN; static PyObject *__pyx_n_IP6_HLIM_DEFAULT; static PyObject *__pyx_n_IP6_HLIM_MAX; static PyObject *__pyx_n_IP6_ADDR_UNSPEC; static PyObject *__pyx_n_IP6_ADDR_LOOPBACK; static PyObject *__pyx_n_ip6_ntoa; static PyObject *__pyx_n_ip6_aton; static PyObject *__pyx_n_ip6_checksum; static PyObject *__pyx_n_ip6_pack_hdr; static PyObject *__pyx_n_ADDR_TYPE_NONE; static PyObject *__pyx_n_ADDR_TYPE_ETH; static PyObject *__pyx_n_ADDR_TYPE_IP; static PyObject *__pyx_n_ADDR_TYPE_IP6; static PyObject *__pyx_n_ARP_HDR_LEN; static PyObject *__pyx_n_ARP_ETHIP_LEN; static PyObject *__pyx_n_ARP_HRD_ETH; static PyObject *__pyx_n_ARP_HRD_IEEE802; static PyObject *__pyx_n_ARP_PRO_IP; static PyObject *__pyx_n_ARP_OP_REQUEST; static PyObject *__pyx_n_ARP_OP_REPLY; static PyObject *__pyx_n_ARP_OP_REVREQUEST; static PyObject *__pyx_n_ARP_OP_REVREPLY; static PyObject *__pyx_n_arp_pack_hdr_ethip; static PyObject *__pyx_n_icmp_pack_hdr; static PyObject *__pyx_n_TCP_HDR_LEN; static PyObject *__pyx_n_TH_FIN; static PyObject *__pyx_n_TH_SYN; static PyObject *__pyx_n_TH_RST; static PyObject *__pyx_n_TH_PUSH; static PyObject *__pyx_n_TH_ACK; static PyObject *__pyx_n_TH_URG; static PyObject *__pyx_n_TH_ECE; static PyObject *__pyx_n_TH_CWR; static PyObject *__pyx_n_TCP_PORT_MAX; static PyObject *__pyx_n_TCP_WIN_MAX; static PyObject *__pyx_n_TCP_OPT_EOL; static PyObject *__pyx_n_TCP_OPT_NOP; static PyObject *__pyx_n_TCP_OPT_MSS; static PyObject *__pyx_n_TCP_OPT_WSCALE; static PyObject *__pyx_n_TCP_OPT_SACKOK; static PyObject *__pyx_n_TCP_OPT_SACK; static PyObject *__pyx_n_TCP_OPT_ECHO; static PyObject *__pyx_n_TCP_OPT_ECHOREPLY; static PyObject *__pyx_n_TCP_OPT_TIMESTAMP; static PyObject *__pyx_n_TCP_OPT_POCONN; static PyObject *__pyx_n_TCP_OPT_POSVC; static PyObject *__pyx_n_TCP_OPT_CC; static PyObject *__pyx_n_TCP_OPT_CCNEW; static PyObject *__pyx_n_TCP_OPT_CCECHO; static PyObject *__pyx_n_TCP_OPT_ALTSUM; static PyObject *__pyx_n_TCP_OPT_ALTSUMDATA; static PyObject *__pyx_n_TCP_OPT_SKEETER; static PyObject *__pyx_n_TCP_OPT_BUBBA; static PyObject *__pyx_n_TCP_OPT_TRAILSUM; static PyObject *__pyx_n_TCP_OPT_MD5; static PyObject *__pyx_n_TCP_OPT_SCPS; static PyObject *__pyx_n_TCP_OPT_SNACK; static PyObject *__pyx_n_TCP_OPT_REC; static PyObject *__pyx_n_TCP_OPT_CORRUPT; static PyObject *__pyx_n_TCP_OPT_SNAP; static PyObject *__pyx_n_TCP_OPT_TCPCOMP; static PyObject *__pyx_n_TCP_OPT_MAX; static PyObject *__pyx_n_tcp_pack_hdr; static PyObject *__pyx_n_UDP_HDR_LEN; static PyObject *__pyx_n_UDP_PORT_MAX; static PyObject *__pyx_n_udp_pack_hdr; static PyObject *__pyx_n_INTF_TYPE_OTHER; static PyObject *__pyx_n_INTF_TYPE_ETH; static PyObject *__pyx_n_INTF_TYPE_LOOPBACK; static PyObject *__pyx_n_INTF_TYPE_TUN; static PyObject *__pyx_n_INTF_FLAG_UP; static PyObject *__pyx_n_INTF_FLAG_LOOPBACK; static PyObject *__pyx_n_INTF_FLAG_POINTOPOINT; static PyObject *__pyx_n_INTF_FLAG_NOARP; static PyObject *__pyx_n_INTF_FLAG_BROADCAST; static PyObject *__pyx_n_INTF_FLAG_MULTICAST; static PyObject *__pyx_n_FW_OP_ALLOW; static PyObject *__pyx_n_FW_OP_BLOCK; static PyObject *__pyx_n_FW_DIR_IN; static PyObject *__pyx_n_FW_DIR_OUT; static PyObject *__pyx_n_BSD; static PyObject *__pyx_k9p; static PyObject *__pyx_k10p; static PyObject *__pyx_k12p; static PyObject *__pyx_k13p; static PyObject *__pyx_n_ValueError; static PyObject *__pyx_k60p; static char (__pyx_k60[]) = "not a %d-byte binary string: %r"; static PyObject *__pyx_f_4dnet___memcpy(char (*__pyx_v_dst),PyObject *__pyx_v_src,int __pyx_v_n) { PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; char (*__pyx_5); Py_INCREF(__pyx_v_src); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":44 */ __pyx_1 = (PyString_Size(__pyx_v_src) != __pyx_v_n); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":45 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(__pyx_v_n); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); Py_INCREF(__pyx_v_src); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_src); __pyx_3 = 0; __pyx_3 = PyNumber_Remainder(__pyx_k60p, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":46 */ __pyx_5 = PyString_AsString(__pyx_v_src); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; goto __pyx_L1;} memcpy(__pyx_v_dst,__pyx_5,__pyx_v_n); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.__memcpy"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_src); return __pyx_r; } static PyObject *__pyx_f_4dnet___oserror(void) { __PYX_EXTERN_C int errno; PyObject *__pyx_r; PyObject *__pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":50 */ __pyx_1 = PyString_FromString(strerror(errno)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.__oserror"); __pyx_r = 0; __pyx_L0:; return __pyx_r; } static PyObject *__pyx_n_append; static PyObject *__pyx_f_4dnet___iter_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet___iter_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_entry = 0; PyObject *__pyx_v_l = 0; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"entry","l",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_entry, &__pyx_v_l)) return 0; Py_INCREF(__pyx_v_entry); Py_INCREF(__pyx_v_l); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":53 */ __pyx_1 = PyObject_GetAttr(__pyx_v_l, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_INCREF(__pyx_v_entry); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_entry); __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__iter_append"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_entry); Py_DECREF(__pyx_v_l); return __pyx_r; } static PyObject *__pyx_n_OSError; static int __pyx_f_4dnet_3eth___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3eth___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_device = 0; int __pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"device",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_device)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_device); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":110 */ __pyx_1 = PyString_AsString(__pyx_v_device); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;} ((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth = eth_open(__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":111 */ __pyx_2 = (!(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth != 0)); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":112 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} __pyx_4 = __pyx_f_4dnet___oserror(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_4, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.eth.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_device); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_get[] = "Return the MAC address associated with the device as a\n binary string."; static PyObject *__pyx_f_4dnet_3eth_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { eth_addr_t __pyx_v_ea; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":118 */ __pyx_1 = (eth_get(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,(&__pyx_v_ea)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":119 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":120 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_ea.data,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_set[] = "Set the MAC address for the device, returning 0 on success,\n -1 on failure.\n \n Arguments:\n eth_addr -- 6-byte binary string (e.g. \'\\x00\\xde\\xad\\xbe\\xef\\x00\')\n "; static PyObject *__pyx_f_4dnet_3eth_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_value = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"value",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_value)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":130 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_ea.data,__pyx_v_value,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":131 */ __pyx_2 = (eth_set(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,(&__pyx_v_ea)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":132 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_f_4dnet_3eth_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3eth_send[] = "Send an Ethernet frame, returning the number of bytes sent\n or -1 on failure.\n \n Arguments:\n frame -- binary string representing an Ethernet frame\n "; static PyObject *__pyx_f_4dnet_3eth_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_frame = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"frame",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_frame)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_frame); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":141 */ __pyx_1 = PyString_AsString(__pyx_v_frame); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(eth_send(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth,__pyx_1,PyString_Size(__pyx_v_frame))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.eth.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_frame); return __pyx_r; } static void __pyx_f_4dnet_3eth___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3eth___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":144 */ __pyx_1 = (((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":145 */ eth_close(((struct __pyx_obj_4dnet_eth *)__pyx_v_self)->eth); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.eth.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_eth_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_ntoa[] = "Convert an Ethernet MAC address from 6-byte packed binary string to\n a printable string (\'00:de:ad:be:ef:00\')."; static PyObject *__pyx_f_4dnet_eth_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":151 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_ea.data,__pyx_v_buf,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":152 */ __pyx_1 = PyString_FromString(eth_ntoa((&__pyx_v_ea))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.eth_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k61p; static char (__pyx_k61[]) = "invalid Ethernet address"; static PyObject *__pyx_f_4dnet_eth_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_aton[] = "Convert an Ethernet MAC address from a printable string to a\n packed binary string (\'\\x00\\xde\\xad\\xbe\\xef\\x00\')."; static PyObject *__pyx_f_4dnet_eth_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; eth_addr_t __pyx_v_ea; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":158 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} __pyx_2 = (eth_aton(__pyx_1,(&__pyx_v_ea)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":159 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k61p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":160 */ __pyx_3 = PyString_FromStringAndSize(__pyx_v_ea.data,6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.eth_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_eth_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_eth_pack_hdr[] = "Return a packed binary string representing an Ethernet header.\n \n Keyword arguments:\n dst -- destination address (6-byte binary string)\n src -- source address (6-byte binary string)\n type -- Ethernet payload type (ETH_TYPE_*) (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_eth_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dst = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_type = 0; char (__pyx_v_hdr[14]); eth_addr_t __pyx_v_s; eth_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"dst","src","type",0}; __pyx_v_dst = __pyx_k16; __pyx_v_src = __pyx_k17; __pyx_v_type = __pyx_k18; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_dst, &__pyx_v_src, &__pyx_v_type)) return 0; Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":173 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_s.data,__pyx_v_src,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":174 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_d.data,__pyx_v_dst,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":175 */ __pyx_2 = PyInt_AsLong(__pyx_v_type); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} eth_pack_hdr(__pyx_v_hdr,__pyx_v_d,__pyx_v_s,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":176 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,14); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.eth_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_type); return __pyx_r; } static int __pyx_f_4dnet_2ip___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_2ip___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":248 */ ((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip = ip_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":249 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":250 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_2ip_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2ip_send[] = "Send an IP packet, returning the number of bytes sent\n or -1 on failure.\n\n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_2ip_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pkt); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":259 */ __pyx_1 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(ip_send(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip,__pyx_1,PyString_Size(__pyx_v_pkt))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static void __pyx_f_4dnet_2ip___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_2ip___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":262 */ __pyx_1 = (((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":263 */ ip_close(((struct __pyx_obj_4dnet_ip *)__pyx_v_self)->ip); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.ip.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_ip_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_ntoa[] = "Convert an IP address from a 4-byte packed binary string or\n integer to a printable string (\'10.0.0.1\')."; static PyObject *__pyx_f_4dnet_ip_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip_addr_t __pyx_v_ia; unsigned int __pyx_v_i; PyObject *__pyx_r; int __pyx_1; unsigned long __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":271 */ __pyx_1 = PyInt_Check(__pyx_v_buf); if (!__pyx_1) { __pyx_1 = PyLong_Check(__pyx_v_buf); } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":272 */ __pyx_2 = PyInt_AsUnsignedLongMask(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} __pyx_v_i = ntohl(__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":273 */ memcpy(((char (*))(&__pyx_v_ia)),((char (*))(&__pyx_v_i)),4); goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":275 */ __pyx_3 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_ia)),__pyx_v_buf,4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":276 */ __pyx_3 = PyString_FromString(ip_ntoa((&__pyx_v_ia))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k62p; static char (__pyx_k62[]) = "invalid IP address"; static PyObject *__pyx_f_4dnet_ip_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_aton[] = "Convert an IP address from a printable string to a\n packed binary string (\'\\x0a\\x00\\x00\\x01\')."; static PyObject *__pyx_f_4dnet_ip_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip_addr_t __pyx_v_ia; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":282 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} __pyx_2 = (ip_aton(__pyx_1,(&__pyx_v_ia)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":283 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k62p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":284 */ __pyx_3 = PyString_FromStringAndSize(((char (*))(&__pyx_v_ia)),4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_n_TypeError; static PyObject *__pyx_f_4dnet_ip_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_checksum[] = "Return packed binary string representing an IP packet \n with the IP and transport-layer checksums set.\n \n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_ip_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; char (__pyx_v_buf[2048]); char (*__pyx_v_p); int __pyx_v_n; PyObject *__pyx_v_s; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; char (*__pyx_3); static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_pkt); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":296 */ __pyx_1 = (PyObject_AsReadBuffer(__pyx_v_pkt,(&__pyx_v_p),(&__pyx_v_n)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":297 */ __pyx_1 = (__pyx_v_n < 2048); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":298 */ memcpy(__pyx_v_buf,__pyx_v_p,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":299 */ ip_checksum(__pyx_v_buf,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":300 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_buf,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":301 */ __pyx_v_p = malloc(__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":302 */ __pyx_3 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} memcpy(__pyx_v_p,__pyx_3,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":303 */ ip_checksum(__pyx_v_p,__pyx_v_n); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":304 */ __pyx_2 = PyString_FromStringAndSize(__pyx_v_p,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":305 */ free(__pyx_v_p); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":306 */ Py_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":307 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;} __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip_checksum"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_cksum_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_ip_cksum_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; int __pyx_v_sum; char (*__pyx_v_p); int __pyx_v_n; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"buf","sum",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "Oi", __pyx_argnames, &__pyx_v_buf, &__pyx_v_sum)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":312 */ __pyx_1 = (PyObject_AsReadBuffer(__pyx_v_buf,(&__pyx_v_p),(&__pyx_v_n)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":313 */ __pyx_2 = PyInt_FromLong(ip_cksum_add(__pyx_v_p,__pyx_v_n,__pyx_v_sum)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":315 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.ip_cksum_add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_cksum_carry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_ip_cksum_carry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_sum; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"sum",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_sum)) return 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":318 */ __pyx_1 = PyInt_FromLong(ip_cksum_carry(__pyx_v_sum)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip_cksum_carry"); __pyx_r = 0; __pyx_L0:; return __pyx_r; } static PyObject *__pyx_f_4dnet_ip_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip_pack_hdr[] = "Return a packed binary string representing an IP header.\n \n Keyword arguments:\n tos -- type of service (8-bit integer)\n len -- length (IP_HDR_LEN + payload) (16-bit integer)\n id -- packet ID (16-bit integer)\n off -- fragmentation offset (16-bit integer)\n ttl -- time-to-live (8-bit integer)\n p -- protocol (IP_PROTO_*) (8-bit integer)\n src -- source address (4-byte binary string)\n dst -- destination address (4-byte binary string)\n "; static PyObject *__pyx_f_4dnet_ip_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tos = 0; PyObject *__pyx_v_len = 0; PyObject *__pyx_v_id = 0; PyObject *__pyx_v_off = 0; PyObject *__pyx_v_ttl = 0; PyObject *__pyx_v_p = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_dst = 0; char (__pyx_v_hdr[20]); ip_addr_t __pyx_v_s; ip_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; int __pyx_3; int __pyx_4; int __pyx_5; int __pyx_6; int __pyx_7; static char *__pyx_argnames[] = {"tos","len","id","off","ttl","p","src","dst",0}; __pyx_v_tos = __pyx_k24; __pyx_v_len = __pyx_k25; __pyx_v_id = __pyx_k26; __pyx_v_off = __pyx_k27; __pyx_v_ttl = __pyx_k28; __pyx_v_p = __pyx_k29; __pyx_v_src = __pyx_k30; __pyx_v_dst = __pyx_k31; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOO", __pyx_argnames, &__pyx_v_tos, &__pyx_v_len, &__pyx_v_id, &__pyx_v_off, &__pyx_v_ttl, &__pyx_v_p, &__pyx_v_src, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_tos); Py_INCREF(__pyx_v_len); Py_INCREF(__pyx_v_id); Py_INCREF(__pyx_v_off); Py_INCREF(__pyx_v_ttl); Py_INCREF(__pyx_v_p); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":337 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_s)),__pyx_v_src,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":338 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_d)),__pyx_v_dst,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":339 */ __pyx_2 = PyInt_AsLong(__pyx_v_tos); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_v_id); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_off); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_ttl); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} __pyx_7 = PyInt_AsLong(__pyx_v_p); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} ip_pack_hdr(__pyx_v_hdr,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7,__pyx_v_s,__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":340 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,20); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_tos); Py_DECREF(__pyx_v_len); Py_DECREF(__pyx_v_id); Py_DECREF(__pyx_v_off); Py_DECREF(__pyx_v_ttl); Py_DECREF(__pyx_v_p); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_ntoa[] = "Convert an IPv6 address from a 16-byte packed binary string to a\n printable string (\'10.0.0.1\')."; static PyObject *__pyx_f_4dnet_ip6_ntoa(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip6_addr_t __pyx_v_ia; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":374 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_ia)),__pyx_v_buf,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":375 */ __pyx_1 = PyString_FromString(ip6_ntoa((&__pyx_v_ia))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip6_ntoa"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_k63p; static char (__pyx_k63[]) = "invalid IPv6 address"; static PyObject *__pyx_f_4dnet_ip6_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_aton[] = "Convert an IPv6 address from a printable string to a\n packed binary string (\'\\x0a\\x00\\x00\\x01\')."; static PyObject *__pyx_f_4dnet_ip6_aton(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; ip6_addr_t __pyx_v_ia; PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":381 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;} __pyx_2 = (ip6_aton(__pyx_1,(&__pyx_v_ia)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":382 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k63p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":383 */ __pyx_3 = PyString_FromStringAndSize(((char (*))(&__pyx_v_ia)),16); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.ip6_aton"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_checksum[] = "Return a packed binary string representing an IPv6 packet \n with the IPv6 and transport-layer checksums set.\n\n Arguments:\n pkt -- binary string representing an IPv6 packet\n "; static PyObject *__pyx_f_4dnet_ip6_checksum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":392 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} ip6_checksum(__pyx_1,PyString_Size(__pyx_v_buf)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":393 */ Py_INCREF(__pyx_v_buf); __pyx_r = __pyx_v_buf; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.ip6_checksum"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_ip6_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_ip6_pack_hdr[] = "Return a packed binary string representing an IPv6 header.\n \n Keyword arguments:\n fc -- flow class (8-bit integer)\n fl -- flow label (20-bit integer)\n plen -- payload length (16-bit integer)\n nxt -- next header (IP_PROTO_*) (8-bit integer)\n hlim -- hop limit (8-bit integer)\n src -- source address (16-byte binary string)\n dst -- destination address (16-byte binary string)\n "; static PyObject *__pyx_f_4dnet_ip6_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fc = 0; PyObject *__pyx_v_fl = 0; PyObject *__pyx_v_plen = 0; PyObject *__pyx_v_nxt = 0; PyObject *__pyx_v_hlim = 0; PyObject *__pyx_v_src = 0; PyObject *__pyx_v_dst = 0; char (__pyx_v_hdr[40]); ip6_addr_t __pyx_v_s; ip6_addr_t __pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; int __pyx_3; int __pyx_4; int __pyx_5; int __pyx_6; static char *__pyx_argnames[] = {"fc","fl","plen","nxt","hlim","src","dst",0}; __pyx_v_fc = __pyx_k34; __pyx_v_fl = __pyx_k35; __pyx_v_plen = __pyx_k36; __pyx_v_nxt = __pyx_k37; __pyx_v_hlim = __pyx_k38; __pyx_v_src = __pyx_k39; __pyx_v_dst = __pyx_k40; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOO", __pyx_argnames, &__pyx_v_fc, &__pyx_v_fl, &__pyx_v_plen, &__pyx_v_nxt, &__pyx_v_hlim, &__pyx_v_src, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_fc); Py_INCREF(__pyx_v_fl); Py_INCREF(__pyx_v_plen); Py_INCREF(__pyx_v_nxt); Py_INCREF(__pyx_v_hlim); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":410 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_s)),__pyx_v_src,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":411 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_d)),__pyx_v_dst,16); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":412 */ __pyx_2 = PyInt_AsLong(__pyx_v_fc); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_fl); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_v_plen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_nxt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_hlim); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} ip6_pack_hdr(__pyx_v_hdr,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_v_s,__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":413 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_hdr,40); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.ip6_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_fc); Py_DECREF(__pyx_v_fl); Py_DECREF(__pyx_v_plen); Py_DECREF(__pyx_v_nxt); Py_DECREF(__pyx_v_hlim); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_n_ip; static PyObject *__pyx_k64p; static char (__pyx_k64[]) = "invalid network address"; static int __pyx_f_4dnet_4addr___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4addr___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addrtxt = 0; PyObject *__pyx_v_type = 0; int __pyx_r; int __pyx_1; char (*__pyx_2); PyObject *__pyx_3 = 0; unsigned short __pyx_4; static char *__pyx_argnames[] = {"addrtxt","type",0}; __pyx_v_addrtxt = __pyx_k41; __pyx_v_type = __pyx_k42; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_addrtxt, &__pyx_v_type)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_addrtxt); Py_INCREF(__pyx_v_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":445 */ if (PyObject_Cmp(__pyx_v_addrtxt, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; if (__pyx_1) { __pyx_2 = PyString_AsString(__pyx_v_addrtxt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} __pyx_1 = (addr_aton(__pyx_2,(&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr)) < 0); } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":446 */ __pyx_1 = (PyString_Size(__pyx_v_addrtxt) == 4); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":447 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":448 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":449 */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_ip, __pyx_v_addrtxt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} goto __pyx_L3; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":451 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_k64p, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_addrtxt); Py_DECREF(__pyx_v_type); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_4type___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4type___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":456 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.addr.type.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_OverflowError; static int __pyx_f_4dnet_4addr_4type___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_f_4dnet_4addr_4type___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { unsigned int __pyx_v_value; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_value = PyInt_AsUnsignedLongMask(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":458 */ __pyx_1 = (__pyx_v_value > 65535); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":459 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_v_value; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.type.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_4bits___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4bits___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":464 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.addr.bits.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_4addr_4bits___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ static int __pyx_f_4dnet_4addr_4bits___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { unsigned int __pyx_v_value; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); __pyx_v_value = PyInt_AsUnsignedLongMask(__pyx_arg_value); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":466 */ __pyx_1 = (__pyx_v_value > 65535); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OverflowError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":467 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_v_value; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.bits.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_eth; static PyObject *__pyx_n_ip6; static PyObject *__pyx_k65p; static char (__pyx_k65[]) = "invalid network address"; static PyObject *__pyx_f_4dnet_4addr_4data___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_4data___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":472 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":473 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_eth); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_2 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":475 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ip); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":477 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_ip6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":479 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k65p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.data.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k66p; static char (__pyx_k66[]) = "non-Ethernet address"; static PyObject *__pyx_f_4dnet_4addr_3eth___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_3eth___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":484 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":485 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k66p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":486 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.eth.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k67p; static char (__pyx_k67[]) = "not a 6-byte string"; static int __pyx_f_4dnet_4addr_3eth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_3eth___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":489 */ __pyx_1 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":490 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k67p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":491 */ __pyx_2 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":492 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":493 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BITS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.eth.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_k68p; static char (__pyx_k68[]) = "non-IP address"; static PyObject *__pyx_f_4dnet_4addr_2ip___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_2ip___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":498 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":499 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k68p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":500 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k69p; static char (__pyx_k69[]) = "not a 4-byte string"; static int __pyx_f_4dnet_4addr_2ip___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_2ip___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":504 */ __pyx_1 = PyInt_Check(__pyx_v_value); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":505 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip = htonl(PyInt_AsLong(__pyx_v_value)); goto __pyx_L2; } __pyx_1 = PyLong_Check(__pyx_v_value); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":507 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip = htonl(PyLong_AsUnsignedLong(__pyx_v_value)); goto __pyx_L2; } __pyx_2 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_LEN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":509 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k69p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;} goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":511 */ __pyx_3 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":512 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":513 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.ip.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_k70p; static char (__pyx_k70[]) = "non-IPv6 address"; static PyObject *__pyx_f_4dnet_4addr_3ip6___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr_3ip6___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":518 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":519 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k70p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":520 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,16); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip6.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k71p; static char (__pyx_k71[]) = "not a 16-byte string"; static int __pyx_f_4dnet_4addr_3ip6___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_f_4dnet_4addr_3ip6___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_value); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":523 */ __pyx_1 = PyInt_FromLong(PyString_Size(__pyx_v_value)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":524 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_k71p, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":525 */ __pyx_2 = __pyx_f_4dnet___memcpy(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8,__pyx_v_value,16); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":526 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":527 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_BITS); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits = __pyx_4; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.ip6.__set__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_value); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_bcast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4addr_bcast[] = "Return an addr object for our broadcast address."; static PyObject *__pyx_f_4dnet_4addr_bcast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bcast; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_bcast = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":531 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_bcast); __pyx_v_bcast = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":532 */ addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_bcast)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":533 */ Py_INCREF(__pyx_v_bcast); __pyx_r = __pyx_v_bcast; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.bcast"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_bcast); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr_net(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4addr_net[] = "Return an addr object for our network address."; static PyObject *__pyx_f_4dnet_4addr_net(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_net; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_net = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":537 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_net); __pyx_v_net = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":538 */ addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_net)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":539 */ Py_INCREF(__pyx_v_net); __pyx_r = __pyx_v_net; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.net"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_net); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n_NotImplementedError; static PyObject *__pyx_n___copy__; static PyObject *__pyx_f_4dnet_4addr___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_x; PyObject *__pyx_v_y; PyObject *__pyx_v_z; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; unsigned long __pyx_5; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_other); __pyx_v_x = Py_None; Py_INCREF(Py_None); __pyx_v_y = Py_None; Py_INCREF(Py_None); __pyx_v_z = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":543 */ __pyx_1 = PyInt_Check(__pyx_v_self); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":544 */ __pyx_2 = __pyx_v_other; Py_INCREF(__pyx_2); __pyx_3 = __pyx_v_self; Py_INCREF(__pyx_3); Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_2; __pyx_2 = 0; Py_DECREF(__pyx_v_y); __pyx_v_y = __pyx_3; __pyx_3 = 0; goto __pyx_L2; } __pyx_1 = PyInt_Check(__pyx_v_other); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":546 */ __pyx_2 = __pyx_v_self; Py_INCREF(__pyx_2); __pyx_3 = __pyx_v_other; Py_INCREF(__pyx_3); Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_2; __pyx_2 = 0; Py_DECREF(__pyx_v_y); __pyx_v_y = __pyx_3; __pyx_3 = 0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":548 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":549 */ __pyx_3 = PyObject_GetAttr(__pyx_v_x, __pyx_n___copy__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} __pyx_4 = PyObject_Call(__pyx_3, __pyx_2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_z); __pyx_v_z = __pyx_4; __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":550 */ __pyx_3 = PyLong_FromUnsignedLong(ntohl(((struct __pyx_obj_4dnet_addr *)__pyx_v_x)->_addr.addr_ip)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} __pyx_2 = PyNumber_Add(__pyx_3, __pyx_v_y); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; ((struct __pyx_obj_4dnet_addr *)__pyx_v_z)->_addr.addr_ip = htonl(__pyx_5); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":551 */ Py_INCREF(__pyx_v_z); __pyx_r = __pyx_v_z; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.addr.__add__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_x); Py_DECREF(__pyx_v_y); Py_DECREF(__pyx_v_z); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_other); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_a; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); __pyx_v_a = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":554 */ __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":555 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_a)->_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":556 */ Py_INCREF(__pyx_v_a); __pyx_r = __pyx_v_a; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__copy__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_4addr___cmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/ static int __pyx_f_4dnet_4addr___cmp__(PyObject *__pyx_v_x, PyObject *__pyx_v_y) { int __pyx_v_i; int __pyx_r; int __pyx_1; Py_INCREF(__pyx_v_x); Py_INCREF(__pyx_v_y); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4dnet_addr, 1, "y")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":560 */ __pyx_v_i = addr_cmp((&((struct __pyx_obj_4dnet_addr *)__pyx_v_x)->_addr),(&((struct __pyx_obj_4dnet_addr *)__pyx_v_y)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":561 */ __pyx_1 = (__pyx_v_i < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":562 */ __pyx_r = (-1); goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":563 */ __pyx_1 = (__pyx_v_i > 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":564 */ __pyx_r = 1; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":565 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.addr.__cmp__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_x); Py_DECREF(__pyx_v_y); return __pyx_r; } static int __pyx_f_4dnet_4addr___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static int __pyx_f_4dnet_4addr___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { struct addr __pyx_v_s1; struct addr __pyx_v_s2; struct addr __pyx_v_o1; struct addr __pyx_v_o2; int __pyx_r; int __pyx_1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_other); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_4dnet_addr, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":569 */ __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_s1)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_s2)) != 0); if (!__pyx_1) { __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_other)->_addr),(&__pyx_v_o1)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_other)->_addr),(&__pyx_v_o2)) != 0); } } } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":573 */ __pyx_r = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":574 */ __pyx_1 = (addr_cmp((&__pyx_v_o1),(&__pyx_v_s1)) >= 0); if (__pyx_1) { __pyx_1 = (addr_cmp((&__pyx_v_o2),(&__pyx_v_s2)) <= 0); } __pyx_r = __pyx_1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.addr.__contains__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_other); return __pyx_r; } static long __pyx_f_4dnet_4addr___hash__(PyObject *__pyx_v_self); /*proto*/ static long __pyx_f_4dnet_4addr___hash__(PyObject *__pyx_v_self) { long __pyx_v_x; long __pyx_v_y; long __pyx_v_size; PyObject *__pyx_v_i; long __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; long __pyx_4; Py_ssize_t __pyx_5; Py_INCREF(__pyx_v_self); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":578 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_ETH); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 6; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 4; goto __pyx_L2; } __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { __pyx_v_size = 16; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":581 */ __pyx_v_x = 3430008; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":582 */ __pyx_v_x = (__pyx_v_x ^ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":583 */ __pyx_v_x = (__pyx_v_x ^ ((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_bits); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":584 */ __pyx_v_y = ((((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8[0]) << 7); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":585 */ for (__pyx_4 = 0+1; __pyx_4 < __pyx_v_size; ++__pyx_4) { __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":586 */ __pyx_5 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;} __pyx_v_y = ((1000003 * __pyx_v_y) ^ (((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_data8[__pyx_5])); __pyx_L3:; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":587 */ __pyx_v_y = (__pyx_v_y ^ __pyx_v_size); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":588 */ __pyx_3 = (__pyx_v_y == (-1)); if (__pyx_3) { __pyx_v_y = (-2); goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":589 */ __pyx_v_x = (__pyx_v_x ^ __pyx_v_y); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":590 */ __pyx_3 = (__pyx_v_x == (-1)); if (__pyx_3) { __pyx_v_x = (-2); goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":591 */ __pyx_r = __pyx_v_x; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__hash__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___int__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":594 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":595 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} __Pyx_Raise(__pyx_1, 0, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":596 */ __pyx_2 = PyLong_FromUnsignedLong(ntohl(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_ip)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__int__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_n___int__; static PyObject *__pyx_f_4dnet_4addr___long__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___long__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":599 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___int__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} __pyx_3 = PyObject_Call(__pyx_1, __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.addr.__long__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4addr___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___iter__(PyObject *__pyx_v_self) { struct addr __pyx_v_a; struct addr __pyx_v_b; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":603 */ __pyx_2 = PyInt_FromLong(((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} __pyx_1 = __pyx_1 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (!__pyx_1) { __pyx_1 = (addr_net((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_a)) != 0); if (!__pyx_1) { __pyx_1 = (addr_bcast((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr),(&__pyx_v_b)) != 0); } } if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":606 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":615 */ __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_a.addr_ip); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_b.addr_ip); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); __pyx_3 = 0; __pyx_2 = 0; __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___addr_ip4_iter), __pyx_4, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.addr.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_k72p; static char (__pyx_k72[]) = ""; static PyObject *__pyx_f_4dnet_4addr___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4addr___repr__(PyObject *__pyx_v_self) { char (*__pyx_v_p); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":619 */ __pyx_v_p = addr_ntoa((&((struct __pyx_obj_4dnet_addr *)__pyx_v_self)->_addr)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":620 */ __pyx_1 = (!(__pyx_v_p != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":621 */ Py_INCREF(__pyx_k72p); __pyx_r = __pyx_k72p; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":622 */ __pyx_2 = PyString_FromString(__pyx_v_p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.addr.__repr__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_15__addr_ip4_iter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_15__addr_ip4_iter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cur = 0; PyObject *__pyx_v_max = 0; int __pyx_r; unsigned long __pyx_1; static char *__pyx_argnames[] = {"cur","max",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_cur, &__pyx_v_max)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_cur); Py_INCREF(__pyx_v_max); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":629 */ __pyx_1 = PyInt_AsUnsignedLongMask(__pyx_v_cur); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur = ntohl(__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":630 */ __pyx_1 = PyInt_AsUnsignedLongMask(__pyx_v_max); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; goto __pyx_L1;} ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->max = ntohl(__pyx_1); __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__addr_ip4_iter.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_cur); Py_DECREF(__pyx_v_max); return __pyx_r; } static PyObject *__pyx_n_StopIteration; static PyObject *__pyx_f_4dnet_15__addr_ip4_iter___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_15__addr_ip4_iter___next__(PyObject *__pyx_v_self) { struct __pyx_obj_4dnet_addr *__pyx_v_next; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; unsigned short __pyx_4; Py_INCREF(__pyx_v_self); __pyx_v_next = ((struct __pyx_obj_4dnet_addr *)Py_None); Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":634 */ __pyx_1 = (((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur <= ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":635 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4dnet_addr)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_next)); __pyx_v_next = ((struct __pyx_obj_4dnet_addr *)__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":636 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_next->_addr.addr_type = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":637 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_BITS); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_next->_addr.addr_bits = __pyx_4; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":638 */ __pyx_v_next->_addr.addr_ip = htonl(((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":639 */ ((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur = (((struct __pyx_obj_4dnet___addr_ip4_iter *)__pyx_v_self)->cur + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":640 */ Py_INCREF(((PyObject *)__pyx_v_next)); __pyx_r = ((PyObject *)__pyx_v_next); goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":642 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__addr_ip4_iter.__next__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_next); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet___arp_callback(struct arp_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_pa; PyObject *__pyx_v_ha; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_pa = Py_None; Py_INCREF(Py_None); __pyx_v_ha = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":680 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":681 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_pa); __pyx_v_pa = __pyx_3; __pyx_3 = 0; Py_DECREF(__pyx_v_ha); __pyx_v_ha = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":682 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_pa)->_addr = __pyx_v_entry->arp_pa; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":683 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_ha)->_addr = __pyx_v_entry->arp_ha; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":684 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_INCREF(__pyx_v_pa); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_pa); Py_INCREF(__pyx_v_ha); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_ha); __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_1 = 0; __pyx_2 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":685 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":686 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":687 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__arp_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_pa); Py_DECREF(__pyx_v_ha); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_3arp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3arp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":697 */ ((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp = arp_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":698 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":699 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_add[] = "Add an entry to the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n ha -- ADDR_TYPE_ETH network address object\n "; static PyObject *__pyx_f_4dnet_3arp_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct __pyx_obj_4dnet_addr *__pyx_v_ha = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa","ha",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_pa, &__pyx_v_ha)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); Py_INCREF(__pyx_v_ha); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ha), __pyx_ptype_4dnet_addr, 1, "ha")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":709 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":710 */ __pyx_v_entry.arp_ha = __pyx_v_ha->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":711 */ __pyx_1 = (arp_add(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":712 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); Py_DECREF(__pyx_v_ha); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_delete[] = "Delete an entry from the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_3arp_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pa)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":721 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":722 */ __pyx_1 = (arp_delete(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":723 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_get[] = "Return the hardware address for a given protocol address\n in the system ARP table.\n\n Arguments:\n pa -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_3arp_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_pa = 0; struct arp_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"pa",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pa)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pa); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pa), __pyx_ptype_4dnet_addr, 1, "pa")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":733 */ __pyx_v_entry.arp_pa = __pyx_v_pa->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":734 */ __pyx_1 = (arp_get(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,(&__pyx_v_entry)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":735 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry.arp_ha))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":736 */ Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pa); return __pyx_r; } static PyObject *__pyx_f_4dnet_3arp_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3arp_loop[] = "Iterate over the system ARP table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with ((pa, ha), arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_3arp_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k43; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":748 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":749 */ __pyx_1 = PyInt_FromLong(arp_loop(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp,__pyx_f_4dnet___arp_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.arp.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_n_loop; static PyObject *__pyx_n_iter; static PyObject *__pyx_f_4dnet_3arp___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3arp___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":752 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":753 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":754 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.arp.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_3arp___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3arp___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":757 */ __pyx_1 = (((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":758 */ arp_close(((struct __pyx_obj_4dnet_arp *)__pyx_v_self)->arp); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.arp.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_f_4dnet_arp_pack_hdr_ethip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_arp_pack_hdr_ethip[] = "Return a packed binary string representing an Ethernet/IP ARP message.\n \n Keyword arguments:\n op -- operation (ARP_OP_*) (16-bit integer)\n sha -- sender Ethernet address (6-byte binary string)\n spa -- sender IP address (4-byte binary string)\n dha -- destination Ethernet address (6-byte binary string)\n dpa -- destination IP address (4-byte binary string)\n "; static PyObject *__pyx_f_4dnet_arp_pack_hdr_ethip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_op = 0; PyObject *__pyx_v_sha = 0; PyObject *__pyx_v_spa = 0; PyObject *__pyx_v_dha = 0; PyObject *__pyx_v_dpa = 0; char (__pyx_v_buf[28]); eth_addr_t __pyx_v_sh; eth_addr_t __pyx_v_dh; ip_addr_t __pyx_v_sp; ip_addr_t __pyx_v_dp; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"op","sha","spa","dha","dpa",0}; __pyx_v_op = __pyx_k44; __pyx_v_sha = __pyx_k45; __pyx_v_spa = __pyx_k46; __pyx_v_dha = __pyx_k47; __pyx_v_dpa = __pyx_k48; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOO", __pyx_argnames, &__pyx_v_op, &__pyx_v_sha, &__pyx_v_spa, &__pyx_v_dha, &__pyx_v_dpa)) return 0; Py_INCREF(__pyx_v_op); Py_INCREF(__pyx_v_sha); Py_INCREF(__pyx_v_spa); Py_INCREF(__pyx_v_dha); Py_INCREF(__pyx_v_dpa); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":775 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_sh.data,__pyx_v_sha,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":776 */ __pyx_1 = __pyx_f_4dnet___memcpy(__pyx_v_dh.data,__pyx_v_dha,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":777 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_sp)),__pyx_v_spa,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":778 */ __pyx_1 = __pyx_f_4dnet___memcpy(((char (*))(&__pyx_v_dp)),__pyx_v_dpa,4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":779 */ __pyx_2 = PyInt_AsLong(__pyx_v_op); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} arp_pack_hdr_ethip(__pyx_v_buf,__pyx_2,__pyx_v_sh,__pyx_v_sp,__pyx_v_dh,__pyx_v_dp); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":780 */ __pyx_1 = PyString_FromStringAndSize(__pyx_v_buf,28); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.arp_pack_hdr_ethip"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_op); Py_DECREF(__pyx_v_sha); Py_DECREF(__pyx_v_spa); Py_DECREF(__pyx_v_dha); Py_DECREF(__pyx_v_dpa); return __pyx_r; } static PyObject *__pyx_f_4dnet_icmp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_icmp_pack_hdr[] = "Return a packed binary string representing an ICMP header.\n\n Keyword arguments:\n type -- ICMP type (8-bit integer)\n code -- ICMP code (8-bit integer)\n "; static PyObject *__pyx_f_4dnet_icmp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_type = 0; PyObject *__pyx_v_code = 0; char (__pyx_v_buf[4]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"type","code",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_type, &__pyx_v_code)) return 0; Py_INCREF(__pyx_v_type); Py_INCREF(__pyx_v_code); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":796 */ __pyx_1 = PyInt_AsLong(__pyx_v_type); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_code); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} icmp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":797 */ __pyx_3 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.icmp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_type); Py_DECREF(__pyx_v_code); return __pyx_r; } static PyObject *__pyx_f_4dnet_tcp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_tcp_pack_hdr[] = "Return a packed binary string representing a TCP header.\n\n Keyword arguments:\n sport -- source port (16-bit integer)\n dport -- destination port (16-bit integer)\n seq -- sequence number (32-bit integer)\n ack -- acknowledgment number (32-bit integer)\n flags -- control flags (TH_*) (8-bit integer bitmask)\n win -- window size (16-bit integer)\n urp -- urgent pointer (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_tcp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sport = 0; PyObject *__pyx_v_dport = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_ack = 0; PyObject *__pyx_v_flags = 0; PyObject *__pyx_v_win = 0; PyObject *__pyx_v_urp = 0; char (__pyx_v_buf[20]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; unsigned long __pyx_3; unsigned long __pyx_4; int __pyx_5; int __pyx_6; int __pyx_7; PyObject *__pyx_8 = 0; static char *__pyx_argnames[] = {"sport","dport","seq","ack","flags","win","urp",0}; __pyx_v_seq = __pyx_k49; __pyx_v_ack = __pyx_k50; __pyx_v_flags = __pyx_k51; __pyx_v_win = __pyx_k52; __pyx_v_urp = __pyx_k53; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|OOOOO", __pyx_argnames, &__pyx_v_sport, &__pyx_v_dport, &__pyx_v_seq, &__pyx_v_ack, &__pyx_v_flags, &__pyx_v_win, &__pyx_v_urp)) return 0; Py_INCREF(__pyx_v_sport); Py_INCREF(__pyx_v_dport); Py_INCREF(__pyx_v_seq); Py_INCREF(__pyx_v_ack); Py_INCREF(__pyx_v_flags); Py_INCREF(__pyx_v_win); Py_INCREF(__pyx_v_urp); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":862 */ __pyx_1 = PyInt_AsLong(__pyx_v_sport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_dport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_3 = PyInt_AsUnsignedLongMask(__pyx_v_seq); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_ack); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_5 = PyInt_AsLong(__pyx_v_flags); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_6 = PyInt_AsLong(__pyx_v_win); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} __pyx_7 = PyInt_AsLong(__pyx_v_urp); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} tcp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2,__pyx_3,__pyx_4,__pyx_5,__pyx_6,__pyx_7); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":863 */ __pyx_8 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} __pyx_r = __pyx_8; __pyx_8 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_8); __Pyx_AddTraceback("dnet.tcp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_sport); Py_DECREF(__pyx_v_dport); Py_DECREF(__pyx_v_seq); Py_DECREF(__pyx_v_ack); Py_DECREF(__pyx_v_flags); Py_DECREF(__pyx_v_win); Py_DECREF(__pyx_v_urp); return __pyx_r; } static PyObject *__pyx_f_4dnet_udp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_udp_pack_hdr[] = "Return a packed binary string representing a UDP header.\n\n Keyword arguments:\n sport -- source port (16-bit integer)\n dport -- destination port (16-bit integer)\n ulen -- UDP header + data length (16-bit integer)\n "; static PyObject *__pyx_f_4dnet_udp_pack_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sport = 0; PyObject *__pyx_v_dport = 0; PyObject *__pyx_v_ulen = 0; char (__pyx_v_buf[8]); PyObject *__pyx_r; int __pyx_1; int __pyx_2; int __pyx_3; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"sport","dport","ulen",0}; __pyx_v_ulen = __pyx_k54; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_sport, &__pyx_v_dport, &__pyx_v_ulen)) return 0; Py_INCREF(__pyx_v_sport); Py_INCREF(__pyx_v_dport); Py_INCREF(__pyx_v_ulen); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":883 */ __pyx_1 = PyInt_AsLong(__pyx_v_sport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} __pyx_2 = PyInt_AsLong(__pyx_v_dport); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_v_ulen); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} udp_pack_hdr(__pyx_v_buf,__pyx_1,__pyx_2,__pyx_3); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":884 */ __pyx_4 = PyString_FromStringAndSize(__pyx_v_buf,(sizeof(__pyx_v_buf))); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.udp_pack_hdr"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_sport); Py_DECREF(__pyx_v_dport); Py_DECREF(__pyx_v_ulen); return __pyx_r; } static PyObject *__pyx_n_name; static PyObject *__pyx_n_type; static PyObject *__pyx_n_flags; static PyObject *__pyx_n_mtu; static PyObject *__pyx_n_addr; static PyObject *__pyx_n_dst_addr; static PyObject *__pyx_n_link_addr; static PyObject *__pyx_n_alias_addrs; static PyObject *__pyx_f_4dnet_ifent_to_dict(struct intf_entry (*__pyx_v_entry)) { PyObject *__pyx_v_d; PyObject *__pyx_v_l; PyObject *__pyx_v_i; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; long __pyx_4; unsigned int __pyx_5; Py_ssize_t __pyx_6; PyObject *__pyx_7 = 0; __pyx_v_d = Py_None; Py_INCREF(Py_None); __pyx_v_l = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":926 */ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":927 */ __pyx_1 = PyString_FromString(__pyx_v_entry->intf_name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_name, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":928 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_type, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":929 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_flags, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":930 */ __pyx_1 = PyLong_FromUnsignedLong(__pyx_v_entry->intf_mtu); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_mtu, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":931 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":932 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_addr))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_addr, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":933 */ __pyx_2 = PyInt_FromLong(__pyx_v_entry->intf_dst_addr.addr_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":934 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_dst_addr))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dst_addr, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":935 */ __pyx_1 = PyInt_FromLong(__pyx_v_entry->intf_link_addr.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} __pyx_3 = __pyx_3 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":936 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_entry->intf_link_addr))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_link_addr, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":937 */ __pyx_3 = (__pyx_v_entry->intf_alias_num > 0); if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":938 */ __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":939 */ __pyx_5 = __pyx_v_entry->intf_alias_num; for (__pyx_4 = 0; __pyx_4 < __pyx_5; ++__pyx_4) { __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":940 */ __pyx_2 = PyObject_GetAttr(__pyx_v_l, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_6 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_1 = PyString_FromString(addr_ntoa((&(__pyx_v_entry->intf_alias_addrs[__pyx_6])))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_7, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(__pyx_2, __pyx_7, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_7); __pyx_7 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_L6:; } __pyx_L7:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":941 */ if (PyObject_SetItem(__pyx_v_d, __pyx_n_alias_addrs, __pyx_v_l) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":942 */ Py_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_7); __Pyx_AddTraceback("dnet.ifent_to_dict"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_d); Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_i); return __pyx_r; } static PyObject *__pyx_n_len; static PyObject *__pyx_f_4dnet_dict_to_ifent(PyObject *__pyx_v_d,struct intf_entry (*__pyx_v_entry)) { PyObject *__pyx_v_s; PyObject *__pyx_v_i; PyObject *__pyx_r; PyObject *__pyx_1 = 0; char (*__pyx_2); int __pyx_3; unsigned short __pyx_4; unsigned int __pyx_5; PyObject *__pyx_6 = 0; PyObject *__pyx_7 = 0; long __pyx_8; Py_ssize_t __pyx_9; Py_INCREF(__pyx_v_d); __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":945 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":946 */ __pyx_2 = PyString_AsString(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} strlcpy(__pyx_v_entry->intf_name,__pyx_2,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":947 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_flags); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":948 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;} __pyx_4 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_entry->intf_flags = __pyx_4; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":949 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_mtu); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":950 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_mtu); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_entry->intf_mtu = __pyx_5; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":951 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":952 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; goto __pyx_L1;} __pyx_v_entry->intf_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":953 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dst_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":954 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dst_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;} __pyx_v_entry->intf_dst_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":955 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_link_addr); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":956 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_link_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; goto __pyx_L1;} __pyx_v_entry->intf_link_addr = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":957 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_alias_addrs); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":958 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} __pyx_6 = PyObject_GetItem(__pyx_v_d, __pyx_n_alias_addrs); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6); __pyx_6 = 0; __pyx_6 = PyObject_Call(__pyx_1, __pyx_7, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_v_entry->intf_alias_num = __pyx_5; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":959 */ __pyx_5 = __pyx_v_entry->intf_alias_num; for (__pyx_8 = 0; __pyx_8 < __pyx_5; ++__pyx_8) { __pyx_1 = PyInt_FromLong(__pyx_8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":960 */ __pyx_7 = PyObject_GetItem(__pyx_v_d, __pyx_n_alias_addrs); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} __pyx_6 = PyObject_GetItem(__pyx_7, __pyx_v_i); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} Py_DECREF(__pyx_7); __pyx_7 = 0; __pyx_9 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} (__pyx_v_entry->intf_alias_addrs[__pyx_9]) = ((struct __pyx_obj_4dnet_addr *)__pyx_6)->_addr; Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_L8:; } __pyx_L9:; goto __pyx_L7; } __pyx_L7:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_6); Py_XDECREF(__pyx_7); __Pyx_AddTraceback("dnet.dict_to_ifent"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_d); return __pyx_r; } static int __pyx_f_4dnet___intf_callback(struct intf_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":963 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":964 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_entry); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_2 = 0; __pyx_1 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":965 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":966 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":967 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__intf_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_4intf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4intf___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":977 */ ((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf = intf_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":978 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":979 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get[] = "Return the configuration for a network interface as a dict.\n "; static PyObject *__pyx_f_4dnet_4intf_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; char (*__pyx_1); int __pyx_2; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; static char *__pyx_argnames[] = {"name",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_name)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_name); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":986 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":987 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":988 */ __pyx_1 = PyString_AsString(__pyx_v_name); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; goto __pyx_L1;} strlcpy(__pyx_v_ifent->intf_name,__pyx_1,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":989 */ __pyx_2 = (intf_get(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":990 */ __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __pyx_4 = __pyx_f_4dnet___oserror(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} __Pyx_Raise(__pyx_3, __pyx_4, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":991 */ __pyx_3 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); __Pyx_AddTraceback("dnet.intf.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_name); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get_src(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get_src[] = "Return the configuration for the interface whose primary address\n matches the specified source address.\n "; static PyObject *__pyx_f_4dnet_4intf_get_src(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_src = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"src",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_src)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_src); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_4dnet_addr, 1, "src")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":999 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1000 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1001 */ __pyx_1 = (intf_get_src(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent,(&__pyx_v_src->_addr)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1002 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1003 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.get_src"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_src); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_get_dst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_get_dst[] = "Return the configuration for the best interface with which to\n reach the specified dst address.\n "; static PyObject *__pyx_f_4dnet_4intf_get_dst(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1011 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1012 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1013 */ __pyx_1 = (intf_get_dst(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent,(&__pyx_v_dst->_addr)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1014 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1015 */ __pyx_2 = __pyx_f_4dnet_ifent_to_dict(__pyx_v_ifent); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.get_dst"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_set[] = "Set the configuration for an interface from a dict.\n\n Dict values:\n name -- name of interface to set (string)\n flags -- interface flags (INTF_FLAG_*) (integer bitmask)\n mtu -- interface MTU (integer)\n addr -- primary network address (addr object)\n dst_addr -- point-to-point dst address (addr object)\n link_addr -- link-layer address (addr object)\n alias_addrs -- additional network addresses (list of addr objects)\n "; static PyObject *__pyx_f_4dnet_4intf_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct intf_entry (*__pyx_v_ifent); char (__pyx_v_buf[1024]); PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1031 */ memset(__pyx_v_buf,0,(sizeof(__pyx_v_buf))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1032 */ __pyx_v_ifent = ((struct intf_entry (*))__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1033 */ __pyx_v_ifent->intf_len = 1024; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1034 */ __pyx_1 = __pyx_f_4dnet_dict_to_ifent(__pyx_v_d,__pyx_v_ifent); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1035 */ __pyx_2 = (intf_set(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_v_ifent) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1036 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4intf_loop[] = "Iterate over the system interface table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with (dict, arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_4intf_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k55; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1048 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1049 */ __pyx_1 = PyInt_FromLong(intf_loop(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf,__pyx_f_4dnet___intf_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.intf.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_4intf___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_4intf___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1052 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1053 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1054 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.intf.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_4intf___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_4intf___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1057 */ __pyx_1 = (((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1058 */ intf_close(((struct __pyx_obj_4dnet_intf *)__pyx_v_self)->intf); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.intf.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static int __pyx_f_4dnet___route_callback(struct route_entry (*__pyx_v_entry),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_dst; PyObject *__pyx_v_gw; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_dst = Py_None; Py_INCREF(Py_None); __pyx_v_gw = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1079 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1080 */ __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_dst); __pyx_v_dst = __pyx_3; __pyx_3 = 0; Py_DECREF(__pyx_v_gw); __pyx_v_gw = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1081 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_dst)->_addr = __pyx_v_entry->route_dst; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1082 */ ((struct __pyx_obj_4dnet_addr *)__pyx_v_gw)->_addr = __pyx_v_entry->route_gw; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1083 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_INCREF(__pyx_v_dst); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_dst); Py_INCREF(__pyx_v_gw); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_gw); __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_1 = 0; __pyx_2 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1084 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1085 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1086 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__route_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_gw); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_5route___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_5route___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1096 */ ((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route = route_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1097 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1098 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_add[] = "Add an entry to the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n gw -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct __pyx_obj_4dnet_addr *__pyx_v_gw = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst","gw",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_dst, &__pyx_v_gw)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_gw); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gw), __pyx_ptype_4dnet_addr, 1, "gw")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1108 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1109 */ __pyx_v_entry.route_gw = __pyx_v_gw->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1110 */ __pyx_1 = (route_add(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1111 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_gw); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_delete[] = "Delete an entry from the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1120 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1121 */ __pyx_1 = (route_delete(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1122 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_get[] = "Return the hardware address for a given protocol address\n in the system routing table.\n\n Arguments:\n dst -- ADDR_TYPE_IP network address object\n "; static PyObject *__pyx_f_4dnet_5route_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; struct route_entry __pyx_v_entry; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"dst",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_dst)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_dst); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1132 */ __pyx_v_entry.route_dst = __pyx_v_dst->_addr; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1133 */ __pyx_1 = (route_get(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,(&__pyx_v_entry)) == 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1134 */ __pyx_2 = PyString_FromString(addr_ntoa((&__pyx_v_entry.route_gw))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1135 */ Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_dst); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_5route_loop[] = "Iterate over the system routing table, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with ((dst, gw), arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_5route_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k56; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1147 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1148 */ __pyx_1 = PyInt_FromLong(route_loop(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route,__pyx_f_4dnet___route_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.route.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_5route___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_5route___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1151 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1152 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1153 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.route.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_5route___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_5route___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1156 */ __pyx_1 = (((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1157 */ route_close(((struct __pyx_obj_4dnet_route *)__pyx_v_self)->route); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.route.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_n_device; static PyObject *__pyx_n_op; static PyObject *__pyx_n_dir; static PyObject *__pyx_n_proto; static PyObject *__pyx_n_src; static PyObject *__pyx_n_dst; static PyObject *__pyx_n_sport; static PyObject *__pyx_n_dport; static PyObject *__pyx_f_4dnet_rule_to_dict(struct fw_rule (*__pyx_v_rule)) { PyObject *__pyx_v_d; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; int __pyx_4; PyObject *__pyx_5 = 0; __pyx_v_d = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1190 */ __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} Py_DECREF(__pyx_v_d); __pyx_v_d = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1191 */ __pyx_1 = PyString_FromString(__pyx_v_rule->fw_device); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_device, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1192 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_op); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_op, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1193 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_dir); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_dir, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1194 */ __pyx_2 = (__pyx_v_rule->fw_proto != 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1195 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} if (PyObject_SetItem(__pyx_v_d, __pyx_n_proto, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1196 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_src.addr_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_3, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} __pyx_2 = __pyx_2 != 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1197 */ __pyx_1 = PyString_FromString(addr_ntoa((&__pyx_v_rule->fw_src))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); __pyx_1 = 0; __pyx_1 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_src, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L3; } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1198 */ __pyx_3 = PyInt_FromLong(__pyx_v_rule->fw_dst.addr_type); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} __pyx_2 = __pyx_2 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1199 */ __pyx_3 = PyString_FromString(addr_ntoa((&__pyx_v_rule->fw_dst))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); __pyx_3 = 0; __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet_addr), __pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dst, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1200 */ __pyx_2 = ((__pyx_v_rule->fw_sport[0]) == 0); if (__pyx_2) { __pyx_2 = ((__pyx_v_rule->fw_sport[1]) == 0); } __pyx_4 = (!__pyx_2); if (__pyx_4) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1201 */ __pyx_1 = PyInt_FromLong((__pyx_v_rule->fw_sport[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} __pyx_3 = PyInt_FromLong((__pyx_v_rule->fw_sport[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} __pyx_5 = PyList_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} PyList_SET_ITEM(__pyx_5, 0, __pyx_1); PyList_SET_ITEM(__pyx_5, 1, __pyx_3); __pyx_1 = 0; __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_sport, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1202 */ __pyx_2 = ((__pyx_v_rule->fw_dport[0]) == 0); if (__pyx_2) { __pyx_2 = ((__pyx_v_rule->fw_dport[1]) == 0); } __pyx_4 = (!__pyx_2); if (__pyx_4) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1203 */ __pyx_1 = PyInt_FromLong((__pyx_v_rule->fw_dport[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} __pyx_3 = PyInt_FromLong((__pyx_v_rule->fw_dport[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} __pyx_5 = PyList_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} PyList_SET_ITEM(__pyx_5, 0, __pyx_1); PyList_SET_ITEM(__pyx_5, 1, __pyx_3); __pyx_1 = 0; __pyx_3 = 0; if (PyObject_SetItem(__pyx_v_d, __pyx_n_dport, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1204 */ Py_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_5); __Pyx_AddTraceback("dnet.rule_to_dict"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_dict_to_rule(PyObject *__pyx_v_d,struct fw_rule (*__pyx_v_rule)) { PyObject *__pyx_v_s; PyObject *__pyx_r; PyObject *__pyx_1 = 0; char (*__pyx_2); int __pyx_3; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; Py_INCREF(__pyx_v_d); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1207 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_device); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1208 */ __pyx_2 = PyString_AsString(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; goto __pyx_L1;} strlcpy(__pyx_v_rule->fw_device,__pyx_2,16); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1209 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_op); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_op = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1210 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dir); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_dir = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1211 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_proto); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1212 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_rule->fw_proto = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1213 */ __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_TCP); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_4, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; if (!__pyx_3) { __pyx_1 = PyInt_FromLong(__pyx_v_rule->fw_proto); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_UDP); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} if (PyObject_Cmp(__pyx_1, __pyx_4, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} __pyx_3 = __pyx_3 == 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; } if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1214 */ (__pyx_v_rule->fw_sport[1]) = 65535; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1215 */ (__pyx_v_rule->fw_dport[1]) = 65535; goto __pyx_L3; } __pyx_L3:; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1216 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_src); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1217 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_src); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; goto __pyx_L1;} __pyx_v_rule->fw_src = ((struct __pyx_obj_4dnet_addr *)__pyx_1)->_addr; Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L4; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1218 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dst); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1219 */ __pyx_4 = PyObject_GetItem(__pyx_v_d, __pyx_n_dst); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; goto __pyx_L1;} __pyx_v_rule->fw_dst = ((struct __pyx_obj_4dnet_addr *)__pyx_4)->_addr; Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L5; } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1220 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_sport); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1221 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_sport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_sport[0]) = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1222 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_sport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_sport[1]) = __pyx_3; goto __pyx_L6; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1223 */ __pyx_3 = PySequence_Contains(__pyx_v_d, __pyx_n_dport); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} if (__pyx_3) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1224 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_dport[0]) = __pyx_3; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1225 */ __pyx_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_dport); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} __pyx_5 = PyObject_GetItem(__pyx_1, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; (__pyx_v_rule->fw_dport[1]) = __pyx_3; goto __pyx_L7; } __pyx_L7:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); __Pyx_AddTraceback("dnet.dict_to_rule"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_d); return __pyx_r; } static int __pyx_f_4dnet___fw_callback(struct fw_rule (*__pyx_v_rule),void (*__pyx_v_arg)) { PyObject *__pyx_v_f; PyObject *__pyx_v_a; PyObject *__pyx_v_ret; int __pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; int __pyx_4; int __pyx_5; __pyx_v_f = Py_None; Py_INCREF(Py_None); __pyx_v_a = Py_None; Py_INCREF(Py_None); __pyx_v_ret = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1228 */ __pyx_1 = (PyObject *)__pyx_v_arg; Py_INCREF(__pyx_1); __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_v_f); __pyx_v_f = __pyx_2; __pyx_2 = 0; __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_v_a); __pyx_v_a = __pyx_3; __pyx_3 = 0; if (__Pyx_EndUnpack(__pyx_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1229 */ __pyx_2 = __pyx_f_4dnet_rule_to_dict(__pyx_v_rule); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_a); __pyx_2 = 0; __pyx_1 = PyObject_Call(__pyx_v_f, __pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1230 */ __pyx_4 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; goto __pyx_L1;} __pyx_5 = (!__pyx_4); if (__pyx_5) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1231 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} Py_DECREF(__pyx_v_ret); __pyx_v_ret = __pyx_2; __pyx_2 = 0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1232 */ __pyx_4 = PyInt_AsLong(__pyx_v_ret); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;} __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.__fw_callback"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_f); Py_DECREF(__pyx_v_a); Py_DECREF(__pyx_v_ret); return __pyx_r; } static int __pyx_f_4dnet_2fw___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_2fw___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1242 */ ((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw = fw_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1243 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1244 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_add[] = "Add a firewall rule specified as a dict.\n\n Dict values:\n device -- interface name (string)\n op -- operation (FW_OP_*) (integer)\n dir -- direction (FW_DIR_*) (integer)\n proto -- IP protocol (IP_PROTO_*) (integer)\n src -- source address / net (addr object)\n dst -- destination address / net (addr object)\n sport -- source port range or ICMP type/mask (list of 2 integers)\n dport -- dest port range or ICMP code/mask (list of 2 integers)\n "; static PyObject *__pyx_f_4dnet_2fw_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct fw_rule __pyx_v_rule; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1260 */ memset(((char (*))(&__pyx_v_rule)),0,(sizeof(__pyx_v_rule))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1261 */ __pyx_1 = __pyx_f_4dnet_dict_to_rule(__pyx_v_d,(&__pyx_v_rule)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1262 */ __pyx_2 = (fw_add(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,(&__pyx_v_rule)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1263 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_delete[] = "Delete a firewall rule specified as a dict."; static PyObject *__pyx_f_4dnet_2fw_delete(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; struct fw_rule __pyx_v_rule; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"d",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_d)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_d); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1268 */ memset(((char (*))(&__pyx_v_rule)),0,(sizeof(__pyx_v_rule))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1269 */ __pyx_1 = __pyx_f_4dnet_dict_to_rule(__pyx_v_d,(&__pyx_v_rule)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1270 */ __pyx_2 = (fw_delete(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,(&__pyx_v_rule)) < 0); if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1271 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} __Pyx_Raise(__pyx_1, __pyx_3, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.delete"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_d); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_2fw_loop[] = "Iterate over the local firewall ruleset, invoking a user callback\n with each entry, returning the status of the callback routine.\n\n Keyword arguments:\n callback -- callback function with (dict, arg) prototype.\n If this function returns a non-zero value, the loop\n will break early.\n arg -- optional callback argument\n "; static PyObject *__pyx_f_4dnet_2fw_loop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_callback = 0; PyObject *__pyx_v_arg = 0; PyObject *__pyx_v__arg; PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {"callback","arg",0}; __pyx_v_arg = __pyx_k57; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_callback, &__pyx_v_arg)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_callback); Py_INCREF(__pyx_v_arg); __pyx_v__arg = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1283 */ __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; goto __pyx_L1;} Py_INCREF(__pyx_v_callback); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_callback); Py_INCREF(__pyx_v_arg); PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_arg); Py_DECREF(__pyx_v__arg); __pyx_v__arg = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1284 */ __pyx_1 = PyInt_FromLong(fw_loop(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw,__pyx_f_4dnet___fw_callback,((void (*))__pyx_v__arg))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.fw.loop"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v__arg); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_callback); Py_DECREF(__pyx_v_arg); return __pyx_r; } static PyObject *__pyx_f_4dnet_2fw___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_2fw___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_v_l; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); __pyx_v_l = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1287 */ __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; goto __pyx_L1;} Py_DECREF(__pyx_v_l); __pyx_v_l = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1288 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_loop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___iter_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_l); __pyx_2 = 0; __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1289 */ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} Py_INCREF(__pyx_v_l); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_l); __pyx_2 = PyObject_Call(__pyx_1, __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.fw.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_l); Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_2fw___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_2fw___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1292 */ __pyx_1 = (((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1293 */ fw_close(((struct __pyx_obj_4dnet_fw *)__pyx_v_self)->fw); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.fw.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static int __pyx_f_4dnet_4rand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_4rand___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1322 */ ((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand = rand_open(); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1323 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1324 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.rand.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_get[] = "Return a string of random bytes.\n \n Arguments:\n len -- number of random bytes to generate\n "; static PyObject *__pyx_f_4dnet_4rand_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_len = 0; char (__pyx_v_buf[1024]); char (*__pyx_v_p); PyObject *__pyx_v_s; PyObject *__pyx_r; PyObject *__pyx_1 = 0; int __pyx_2; static char *__pyx_argnames[] = {"len",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_len)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_len); __pyx_v_s = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1334 */ __pyx_1 = PyInt_FromLong(1024); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_len, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; goto __pyx_L1;} __pyx_2 = __pyx_2 <= 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_2) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1335 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; goto __pyx_L1;} rand_get(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_v_buf,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1336 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} __pyx_1 = PyString_FromStringAndSize(__pyx_v_buf,__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1337 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} __pyx_v_p = malloc(__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1338 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} rand_get(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_v_p,__pyx_2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1339 */ __pyx_2 = PyInt_AsLong(__pyx_v_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} __pyx_1 = PyString_FromStringAndSize(__pyx_v_p,__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_1; __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1340 */ free(__pyx_v_p); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1341 */ Py_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.get"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_s); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_len); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_set[] = "Initialize the PRNG from a known seed.\n \n Arguments:\n string -- binary string seed value\n "; static PyObject *__pyx_f_4dnet_4rand_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1349 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;} rand_set(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_1,PyString_Size(__pyx_v_buf)); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.set"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_add[] = "Add additional entropy into the PRNG mix.\n\n Arguments:\n string -- binary string\n "; static PyObject *__pyx_f_4dnet_4rand_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r; char (*__pyx_1); static char *__pyx_argnames[] = {"buf",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buf)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_buf); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1357 */ __pyx_1 = PyString_AsString(__pyx_v_buf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; goto __pyx_L1;} rand_add(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand,__pyx_1,PyString_Size(__pyx_v_buf)); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.add"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_buf); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint8(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint8[] = "Return a random 8-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint8(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1361 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint8(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint8"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint16[] = "Return a random 16-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint16(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1365 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint16(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint16"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_uint32(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_uint32[] = "Return a random 32-bit integer."; static PyObject *__pyx_f_4dnet_4rand_uint32(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1369 */ __pyx_1 = PyLong_FromUnsignedLong(rand_uint32(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.rand.uint32"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_4rand_xrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_4rand_xrange[] = "xrange([start,] stop) -> xrange object\n\n Return a random permutation iterator to walk an unsigned integer range,\n like xrange().\n "; static PyObject *__pyx_f_4dnet_4rand_xrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"start","stop",0}; __pyx_v_stop = __pyx_k58; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_start, &__pyx_v_stop)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_start); Py_INCREF(__pyx_v_stop); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1377 */ if (PyObject_Cmp(__pyx_v_stop, Py_None, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} __pyx_1 = __pyx_1 == 0; if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1378 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); Py_INCREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_start); __pyx_2 = 0; __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___rand_xrange), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1380 */ __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; goto __pyx_L1;} Py_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self); Py_INCREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_start); Py_INCREF(__pyx_v_stop); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_stop); __pyx_2 = PyObject_Call(((PyObject*)__pyx_ptype_4dnet___rand_xrange), __pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; } __pyx_L2:; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.rand.xrange"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_start); Py_DECREF(__pyx_v_stop); return __pyx_r; } static void __pyx_f_4dnet_4rand___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_4rand___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1383 */ __pyx_1 = (((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1384 */ rand_close(((struct __pyx_obj_4dnet_rand *)__pyx_v_self)->rand); goto __pyx_L2; } __pyx_L2:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.rand.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static PyObject *__pyx_k118p; static PyObject *__pyx_k119p; static char (__pyx_k118[]) = "start must be an integer"; static char (__pyx_k119[]) = "stop must be an integer"; static int __pyx_f_4dnet_13__rand_xrange___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_13__rand_xrange___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_r = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_stop = 0; unsigned int __pyx_v_bits; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"r","start","stop",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_r, &__pyx_v_start, &__pyx_v_stop)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_r); Py_INCREF(__pyx_v_start); Py_INCREF(__pyx_v_stop); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1402 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->rand = ((struct __pyx_obj_4dnet_rand *)__pyx_v_r)->rand; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1403 */ __pyx_1 = PyInt_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1404 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start = PyInt_AsLong(__pyx_v_start); goto __pyx_L2; } __pyx_1 = PyLong_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1406 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start = PyLong_AsUnsignedLong(__pyx_v_start); goto __pyx_L2; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1408 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k118p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1410 */ __pyx_1 = PyInt_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1411 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max = (PyInt_AsLong(__pyx_v_stop) - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start); goto __pyx_L3; } __pyx_1 = PyLong_Check(__pyx_v_start); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1413 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max = (PyLong_AsUnsignedLong(__pyx_v_stop) - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start); goto __pyx_L3; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1415 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_k119p, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; goto __pyx_L1;} } __pyx_L3:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1418 */ rand_get(((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->rand,((char (*))((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox),(sizeof(((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox))); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1420 */ __pyx_v_bits = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1421 */ while (1) { __pyx_L4:; __pyx_1 = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max > (1 << __pyx_v_bits)); if (!__pyx_1) break; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1422 */ __pyx_v_bits = (__pyx_v_bits + 1); } __pyx_L5:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1424 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left = (__pyx_v_bits / 2); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1425 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->right = (__pyx_v_bits - ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1426 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask = ((1 << __pyx_v_bits) - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1428 */ __pyx_1 = (__pyx_e_4dnet_TEASBOXSIZE < (1 << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1429 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask = (__pyx_e_4dnet_TEASBOXSIZE - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1430 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift = __pyx_e_4dnet_TEASBOXSHIFT; goto __pyx_L6; } /*else*/ { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1432 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask = ((1 << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left) - 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1433 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left; } __pyx_L6:; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.__rand_xrange.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_r); Py_DECREF(__pyx_v_start); Py_DECREF(__pyx_v_stop); return __pyx_r; } static PyObject *__pyx_f_4dnet_13__rand_xrange___iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_13__rand_xrange___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1436 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur = 0; ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1438 */ Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__rand_xrange.__iter__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static Py_ssize_t __pyx_f_4dnet_13__rand_xrange___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_f_4dnet_13__rand_xrange___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1441 */ __pyx_r = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.__rand_xrange.__len__"); __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_13__rand_xrange___next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_13__rand_xrange___next__(PyObject *__pyx_v_self) { unsigned long __pyx_v_c; unsigned long __pyx_v_sum; PyObject *__pyx_v_i; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; long __pyx_3; Py_INCREF(__pyx_v_self); __pyx_v_i = Py_None; Py_INCREF(Py_None); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1446 */ __pyx_1 = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur == ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1447 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1448 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->cur + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1449 */ while (1) { __pyx_L3:; __pyx_3 = 1; if (!__pyx_3) break; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1450 */ __pyx_v_c = ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1451 */ ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc = (((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->enc + 1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1452 */ __pyx_v_sum = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1453 */ for (__pyx_3 = 0+1; __pyx_3 < __pyx_e_4dnet_TEAROUNDS; ++__pyx_3) { __pyx_2 = PyInt_FromLong(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; goto __pyx_L1;} Py_DECREF(__pyx_v_i); __pyx_v_i = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1454 */ __pyx_v_sum = (__pyx_v_sum + __pyx_e_4dnet_TEADELTA); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1455 */ __pyx_v_c = (__pyx_v_c ^ ((((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sbox[((__pyx_v_c ^ __pyx_v_sum) & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->sboxmask)]) << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->kshift)); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1456 */ __pyx_v_c = (__pyx_v_c + __pyx_v_sum); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1457 */ __pyx_v_c = (__pyx_v_c & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1458 */ __pyx_v_c = (((__pyx_v_c << ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->left) | (__pyx_v_c >> ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->right)) & ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->mask); __pyx_L5:; } __pyx_L6:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1459 */ __pyx_1 = (__pyx_v_c < ((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->max); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1460 */ goto __pyx_L4; goto __pyx_L7; } __pyx_L7:; } __pyx_L4:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1461 */ __pyx_2 = PyLong_FromUnsignedLong((((struct __pyx_obj_4dnet___rand_xrange *)__pyx_v_self)->start + __pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.__rand_xrange.__next__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_i); Py_DECREF(__pyx_v_self); return __pyx_r; } static int __pyx_f_4dnet_3tun___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_4dnet_3tun___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4dnet_addr *__pyx_v_src = 0; struct __pyx_obj_4dnet_addr *__pyx_v_dst = 0; PyObject *__pyx_v_mtu = 0; int __pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {"src","dst","mtu",0}; __pyx_v_mtu = __pyx_k59; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_src, &__pyx_v_dst, &__pyx_v_mtu)) return -1; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_src); Py_INCREF(__pyx_v_dst); Py_INCREF(__pyx_v_mtu); if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_src), __pyx_ptype_4dnet_addr, 1, "src")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dst), __pyx_ptype_4dnet_addr, 1, "dst")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1491 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun = tun_open((&__pyx_v_src->_addr),(&__pyx_v_dst->_addr),__pyx_1); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1492 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->mtu = __pyx_1; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1493 */ __pyx_1 = (!(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun != 0)); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1494 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1495 */ __pyx_1 = PyInt_AsLong(__pyx_v_mtu); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf = malloc(__pyx_1); __pyx_r = 0; goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.tun.__init__"); __pyx_r = -1; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_src); Py_DECREF(__pyx_v_dst); Py_DECREF(__pyx_v_mtu); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_4name___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_4name___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1500 */ __pyx_1 = PyString_FromString(tun_name(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.name.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_2fd___get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_2fd___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1505 */ __pyx_1 = PyInt_FromLong(tun_fileno(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.fd.__get__"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_fileno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_fileno[] = "Return file descriptor for tunnel handle."; static PyObject *__pyx_f_4dnet_3tun_fileno(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; PyObject *__pyx_1 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1509 */ __pyx_1 = PyInt_FromLong(tun_fileno(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); __Pyx_AddTraceback("dnet.tun.fileno"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_send[] = "Send an IP packet, returning the number of bytes sent\n or -1 on failure.\n\n Arguments:\n pkt -- binary string representing an IP packet\n "; static PyObject *__pyx_f_4dnet_3tun_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pkt = 0; PyObject *__pyx_r; char (*__pyx_1); PyObject *__pyx_2 = 0; static char *__pyx_argnames[] = {"pkt",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_pkt)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_pkt); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1518 */ __pyx_1 = PyString_AsString(__pyx_v_pkt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(tun_send(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun,__pyx_1,PyString_Size(__pyx_v_pkt))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); __Pyx_AddTraceback("dnet.tun.send"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_pkt); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_4dnet_3tun_recv[] = "Return the next packet delivered to the tunnel interface."; static PyObject *__pyx_f_4dnet_3tun_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n; PyObject *__pyx_r; int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1523 */ __pyx_v_n = tun_recv(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun,((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf,((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->mtu); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1524 */ __pyx_1 = (__pyx_v_n < 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1525 */ __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} __pyx_3 = __pyx_f_4dnet___oserror(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} __Pyx_Raise(__pyx_2, __pyx_3, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1526 */ __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); __Pyx_AddTraceback("dnet.tun.recv"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static PyObject *__pyx_f_4dnet_3tun_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_4dnet_3tun_close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r; static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1529 */ ((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun = tun_close(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun); __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.tun.close"); __pyx_r = 0; __pyx_L0:; Py_DECREF(__pyx_v_self); return __pyx_r; } static void __pyx_f_4dnet_3tun___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_f_4dnet_3tun___dealloc__(PyObject *__pyx_v_self) { int __pyx_1; Py_INCREF(__pyx_v_self); /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1532 */ __pyx_1 = (((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1533 */ free(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->buf); goto __pyx_L2; } __pyx_L2:; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1534 */ __pyx_1 = (((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun != 0); if (__pyx_1) { /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1535 */ tun_close(((struct __pyx_obj_4dnet_tun *)__pyx_v_self)->tun); goto __pyx_L3; } __pyx_L3:; goto __pyx_L0; __pyx_L1:; __Pyx_AddTraceback("dnet.tun.__dealloc__"); __pyx_L0:; Py_DECREF(__pyx_v_self); } static __Pyx_InternTabEntry __pyx_intern_tab[] = { {&__pyx_n_ADDR_TYPE_ETH, "ADDR_TYPE_ETH"}, {&__pyx_n_ADDR_TYPE_IP, "ADDR_TYPE_IP"}, {&__pyx_n_ADDR_TYPE_IP6, "ADDR_TYPE_IP6"}, {&__pyx_n_ADDR_TYPE_NONE, "ADDR_TYPE_NONE"}, {&__pyx_n_ARP_ETHIP_LEN, "ARP_ETHIP_LEN"}, {&__pyx_n_ARP_HDR_LEN, "ARP_HDR_LEN"}, {&__pyx_n_ARP_HRD_ETH, "ARP_HRD_ETH"}, {&__pyx_n_ARP_HRD_IEEE802, "ARP_HRD_IEEE802"}, {&__pyx_n_ARP_OP_REPLY, "ARP_OP_REPLY"}, {&__pyx_n_ARP_OP_REQUEST, "ARP_OP_REQUEST"}, {&__pyx_n_ARP_OP_REVREPLY, "ARP_OP_REVREPLY"}, {&__pyx_n_ARP_OP_REVREQUEST, "ARP_OP_REVREQUEST"}, {&__pyx_n_ARP_PRO_IP, "ARP_PRO_IP"}, {&__pyx_n_BSD, "BSD"}, {&__pyx_n_ETH_ADDR_BITS, "ETH_ADDR_BITS"}, {&__pyx_n_ETH_ADDR_BROADCAST, "ETH_ADDR_BROADCAST"}, {&__pyx_n_ETH_ADDR_LEN, "ETH_ADDR_LEN"}, {&__pyx_n_ETH_ADDR_UNSPEC, "ETH_ADDR_UNSPEC"}, {&__pyx_n_ETH_CRC_LEN, "ETH_CRC_LEN"}, {&__pyx_n_ETH_HDR_LEN, "ETH_HDR_LEN"}, {&__pyx_n_ETH_LEN_MAX, "ETH_LEN_MAX"}, {&__pyx_n_ETH_LEN_MIN, "ETH_LEN_MIN"}, {&__pyx_n_ETH_MIN, "ETH_MIN"}, {&__pyx_n_ETH_MTU, "ETH_MTU"}, {&__pyx_n_ETH_TYPE_8021Q, "ETH_TYPE_8021Q"}, {&__pyx_n_ETH_TYPE_ARP, "ETH_TYPE_ARP"}, {&__pyx_n_ETH_TYPE_IP, "ETH_TYPE_IP"}, {&__pyx_n_ETH_TYPE_IPV6, "ETH_TYPE_IPV6"}, {&__pyx_n_ETH_TYPE_LEN, "ETH_TYPE_LEN"}, {&__pyx_n_ETH_TYPE_LOOPBACK, "ETH_TYPE_LOOPBACK"}, {&__pyx_n_ETH_TYPE_MPLS, "ETH_TYPE_MPLS"}, {&__pyx_n_ETH_TYPE_MPLS_MCAST, "ETH_TYPE_MPLS_MCAST"}, {&__pyx_n_ETH_TYPE_PPPOE, "ETH_TYPE_PPPOE"}, {&__pyx_n_ETH_TYPE_PPPOEDISC, "ETH_TYPE_PPPOEDISC"}, {&__pyx_n_ETH_TYPE_PUP, "ETH_TYPE_PUP"}, {&__pyx_n_ETH_TYPE_REVARP, "ETH_TYPE_REVARP"}, {&__pyx_n_FW_DIR_IN, "FW_DIR_IN"}, {&__pyx_n_FW_DIR_OUT, "FW_DIR_OUT"}, {&__pyx_n_FW_OP_ALLOW, "FW_OP_ALLOW"}, {&__pyx_n_FW_OP_BLOCK, "FW_OP_BLOCK"}, {&__pyx_n_INTF_FLAG_BROADCAST, "INTF_FLAG_BROADCAST"}, {&__pyx_n_INTF_FLAG_LOOPBACK, "INTF_FLAG_LOOPBACK"}, {&__pyx_n_INTF_FLAG_MULTICAST, "INTF_FLAG_MULTICAST"}, {&__pyx_n_INTF_FLAG_NOARP, "INTF_FLAG_NOARP"}, {&__pyx_n_INTF_FLAG_POINTOPOINT, "INTF_FLAG_POINTOPOINT"}, {&__pyx_n_INTF_FLAG_UP, "INTF_FLAG_UP"}, {&__pyx_n_INTF_TYPE_ETH, "INTF_TYPE_ETH"}, {&__pyx_n_INTF_TYPE_LOOPBACK, "INTF_TYPE_LOOPBACK"}, {&__pyx_n_INTF_TYPE_OTHER, "INTF_TYPE_OTHER"}, {&__pyx_n_INTF_TYPE_TUN, "INTF_TYPE_TUN"}, {&__pyx_n_IP6_ADDR_BITS, "IP6_ADDR_BITS"}, {&__pyx_n_IP6_ADDR_LEN, "IP6_ADDR_LEN"}, {&__pyx_n_IP6_ADDR_LOOPBACK, "IP6_ADDR_LOOPBACK"}, {&__pyx_n_IP6_ADDR_UNSPEC, "IP6_ADDR_UNSPEC"}, {&__pyx_n_IP6_HDR_LEN, "IP6_HDR_LEN"}, {&__pyx_n_IP6_HLIM_DEFAULT, "IP6_HLIM_DEFAULT"}, {&__pyx_n_IP6_HLIM_MAX, "IP6_HLIM_MAX"}, {&__pyx_n_IP6_LEN_MAX, "IP6_LEN_MAX"}, {&__pyx_n_IP6_LEN_MIN, "IP6_LEN_MIN"}, {&__pyx_n_IP6_MTU_MIN, "IP6_MTU_MIN"}, {&__pyx_n_IP_ADDR_ANY, "IP_ADDR_ANY"}, {&__pyx_n_IP_ADDR_BITS, "IP_ADDR_BITS"}, {&__pyx_n_IP_ADDR_BROADCAST, "IP_ADDR_BROADCAST"}, {&__pyx_n_IP_ADDR_LEN, "IP_ADDR_LEN"}, {&__pyx_n_IP_ADDR_LOOPBACK, "IP_ADDR_LOOPBACK"}, {&__pyx_n_IP_ADDR_MCAST_ALL, "IP_ADDR_MCAST_ALL"}, {&__pyx_n_IP_ADDR_MCAST_LOCAL, "IP_ADDR_MCAST_LOCAL"}, {&__pyx_n_IP_DF, "IP_DF"}, {&__pyx_n_IP_HDR_LEN, "IP_HDR_LEN"}, {&__pyx_n_IP_HDR_LEN_MAX, "IP_HDR_LEN_MAX"}, {&__pyx_n_IP_LEN_MAX, "IP_LEN_MAX"}, {&__pyx_n_IP_LEN_MIN, "IP_LEN_MIN"}, {&__pyx_n_IP_MF, "IP_MF"}, {&__pyx_n_IP_OFFMASK, "IP_OFFMASK"}, {&__pyx_n_IP_OPT_LEN, "IP_OPT_LEN"}, {&__pyx_n_IP_OPT_LEN_MAX, "IP_OPT_LEN_MAX"}, {&__pyx_n_IP_PROTO_AH, "IP_PROTO_AH"}, {&__pyx_n_IP_PROTO_ESP, "IP_PROTO_ESP"}, {&__pyx_n_IP_PROTO_GRE, "IP_PROTO_GRE"}, {&__pyx_n_IP_PROTO_ICMP, "IP_PROTO_ICMP"}, {&__pyx_n_IP_PROTO_ICMPV6, "IP_PROTO_ICMPV6"}, {&__pyx_n_IP_PROTO_IGMP, "IP_PROTO_IGMP"}, {&__pyx_n_IP_PROTO_IP, "IP_PROTO_IP"}, {&__pyx_n_IP_PROTO_IPV6, "IP_PROTO_IPV6"}, {&__pyx_n_IP_PROTO_MAX, "IP_PROTO_MAX"}, {&__pyx_n_IP_PROTO_RAW, "IP_PROTO_RAW"}, {&__pyx_n_IP_PROTO_RESERVED, "IP_PROTO_RESERVED"}, {&__pyx_n_IP_PROTO_TCP, "IP_PROTO_TCP"}, {&__pyx_n_IP_PROTO_UDP, "IP_PROTO_UDP"}, {&__pyx_n_IP_RF, "IP_RF"}, {&__pyx_n_IP_TOS_DEFAULT, "IP_TOS_DEFAULT"}, {&__pyx_n_IP_TTL_DEFAULT, "IP_TTL_DEFAULT"}, {&__pyx_n_IP_TTL_MAX, "IP_TTL_MAX"}, {&__pyx_n_NotImplementedError, "NotImplementedError"}, {&__pyx_n_OSError, "OSError"}, {&__pyx_n_OverflowError, "OverflowError"}, {&__pyx_n_StopIteration, "StopIteration"}, {&__pyx_n_TCP_HDR_LEN, "TCP_HDR_LEN"}, {&__pyx_n_TCP_OPT_ALTSUM, "TCP_OPT_ALTSUM"}, {&__pyx_n_TCP_OPT_ALTSUMDATA, "TCP_OPT_ALTSUMDATA"}, {&__pyx_n_TCP_OPT_BUBBA, "TCP_OPT_BUBBA"}, {&__pyx_n_TCP_OPT_CC, "TCP_OPT_CC"}, {&__pyx_n_TCP_OPT_CCECHO, "TCP_OPT_CCECHO"}, {&__pyx_n_TCP_OPT_CCNEW, "TCP_OPT_CCNEW"}, {&__pyx_n_TCP_OPT_CORRUPT, "TCP_OPT_CORRUPT"}, {&__pyx_n_TCP_OPT_ECHO, "TCP_OPT_ECHO"}, {&__pyx_n_TCP_OPT_ECHOREPLY, "TCP_OPT_ECHOREPLY"}, {&__pyx_n_TCP_OPT_EOL, "TCP_OPT_EOL"}, {&__pyx_n_TCP_OPT_MAX, "TCP_OPT_MAX"}, {&__pyx_n_TCP_OPT_MD5, "TCP_OPT_MD5"}, {&__pyx_n_TCP_OPT_MSS, "TCP_OPT_MSS"}, {&__pyx_n_TCP_OPT_NOP, "TCP_OPT_NOP"}, {&__pyx_n_TCP_OPT_POCONN, "TCP_OPT_POCONN"}, {&__pyx_n_TCP_OPT_POSVC, "TCP_OPT_POSVC"}, {&__pyx_n_TCP_OPT_REC, "TCP_OPT_REC"}, {&__pyx_n_TCP_OPT_SACK, "TCP_OPT_SACK"}, {&__pyx_n_TCP_OPT_SACKOK, "TCP_OPT_SACKOK"}, {&__pyx_n_TCP_OPT_SCPS, "TCP_OPT_SCPS"}, {&__pyx_n_TCP_OPT_SKEETER, "TCP_OPT_SKEETER"}, {&__pyx_n_TCP_OPT_SNACK, "TCP_OPT_SNACK"}, {&__pyx_n_TCP_OPT_SNAP, "TCP_OPT_SNAP"}, {&__pyx_n_TCP_OPT_TCPCOMP, "TCP_OPT_TCPCOMP"}, {&__pyx_n_TCP_OPT_TIMESTAMP, "TCP_OPT_TIMESTAMP"}, {&__pyx_n_TCP_OPT_TRAILSUM, "TCP_OPT_TRAILSUM"}, {&__pyx_n_TCP_OPT_WSCALE, "TCP_OPT_WSCALE"}, {&__pyx_n_TCP_PORT_MAX, "TCP_PORT_MAX"}, {&__pyx_n_TCP_WIN_MAX, "TCP_WIN_MAX"}, {&__pyx_n_TH_ACK, "TH_ACK"}, {&__pyx_n_TH_CWR, "TH_CWR"}, {&__pyx_n_TH_ECE, "TH_ECE"}, {&__pyx_n_TH_FIN, "TH_FIN"}, {&__pyx_n_TH_PUSH, "TH_PUSH"}, {&__pyx_n_TH_RST, "TH_RST"}, {&__pyx_n_TH_SYN, "TH_SYN"}, {&__pyx_n_TH_URG, "TH_URG"}, {&__pyx_n_TypeError, "TypeError"}, {&__pyx_n_UDP_HDR_LEN, "UDP_HDR_LEN"}, {&__pyx_n_UDP_PORT_MAX, "UDP_PORT_MAX"}, {&__pyx_n_ValueError, "ValueError"}, {&__pyx_n___author__, "__author__"}, {&__pyx_n___copy__, "__copy__"}, {&__pyx_n___copyright__, "__copyright__"}, {&__pyx_n___int__, "__int__"}, {&__pyx_n___iter_append, "__iter_append"}, {&__pyx_n___license__, "__license__"}, {&__pyx_n___url__, "__url__"}, {&__pyx_n___version__, "__version__"}, {&__pyx_n_addr, "addr"}, {&__pyx_n_alias_addrs, "alias_addrs"}, {&__pyx_n_append, "append"}, {&__pyx_n_arp_pack_hdr_ethip, "arp_pack_hdr_ethip"}, {&__pyx_n_device, "device"}, {&__pyx_n_dir, "dir"}, {&__pyx_n_dport, "dport"}, {&__pyx_n_dst, "dst"}, {&__pyx_n_dst_addr, "dst_addr"}, {&__pyx_n_eth, "eth"}, {&__pyx_n_eth_aton, "eth_aton"}, {&__pyx_n_eth_ntoa, "eth_ntoa"}, {&__pyx_n_eth_pack_hdr, "eth_pack_hdr"}, {&__pyx_n_flags, "flags"}, {&__pyx_n_icmp_pack_hdr, "icmp_pack_hdr"}, {&__pyx_n_ip, "ip"}, {&__pyx_n_ip6, "ip6"}, {&__pyx_n_ip6_aton, "ip6_aton"}, {&__pyx_n_ip6_checksum, "ip6_checksum"}, {&__pyx_n_ip6_ntoa, "ip6_ntoa"}, {&__pyx_n_ip6_pack_hdr, "ip6_pack_hdr"}, {&__pyx_n_ip_aton, "ip_aton"}, {&__pyx_n_ip_checksum, "ip_checksum"}, {&__pyx_n_ip_cksum_add, "ip_cksum_add"}, {&__pyx_n_ip_cksum_carry, "ip_cksum_carry"}, {&__pyx_n_ip_ntoa, "ip_ntoa"}, {&__pyx_n_ip_pack_hdr, "ip_pack_hdr"}, {&__pyx_n_iter, "iter"}, {&__pyx_n_len, "len"}, {&__pyx_n_link_addr, "link_addr"}, {&__pyx_n_loop, "loop"}, {&__pyx_n_mtu, "mtu"}, {&__pyx_n_name, "name"}, {&__pyx_n_op, "op"}, {&__pyx_n_proto, "proto"}, {&__pyx_n_sport, "sport"}, {&__pyx_n_src, "src"}, {&__pyx_n_tcp_pack_hdr, "tcp_pack_hdr"}, {&__pyx_n_type, "type"}, {&__pyx_n_udp_pack_hdr, "udp_pack_hdr"}, {0, 0} }; static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)}, {&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10)}, {&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)}, {&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13)}, {&__pyx_k60p, __pyx_k60, sizeof(__pyx_k60)}, {&__pyx_k61p, __pyx_k61, sizeof(__pyx_k61)}, {&__pyx_k62p, __pyx_k62, sizeof(__pyx_k62)}, {&__pyx_k63p, __pyx_k63, sizeof(__pyx_k63)}, {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)}, {&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)}, {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)}, {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)}, {&__pyx_k68p, __pyx_k68, sizeof(__pyx_k68)}, {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)}, {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)}, {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)}, {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)}, {&__pyx_k118p, __pyx_k118, sizeof(__pyx_k118)}, {&__pyx_k119p, __pyx_k119, sizeof(__pyx_k119)}, {0, 0, 0} }; static PyObject *__pyx_tp_new_4dnet_eth(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return o; } static void __pyx_tp_dealloc_4dnet_eth(PyObject *o) { struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3eth___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_eth(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return 0; } static int __pyx_tp_clear_4dnet_eth(PyObject *o) { struct __pyx_obj_4dnet_eth *p = (struct __pyx_obj_4dnet_eth *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_eth[] = { {"get", (PyCFunction)__pyx_f_4dnet_3eth_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_get}, {"set", (PyCFunction)__pyx_f_4dnet_3eth_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_set}, {"send", (PyCFunction)__pyx_f_4dnet_3eth_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3eth_send}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_eth = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_eth = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_eth = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_eth = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_eth = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.eth", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_eth), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_eth, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_eth, /*tp_as_number*/ &__pyx_tp_as_sequence_eth, /*tp_as_sequence*/ &__pyx_tp_as_mapping_eth, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_eth, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "eth(device) -> Ethernet device object\n\n Open the specified Ethernet device for sending.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_eth, /*tp_traverse*/ __pyx_tp_clear_4dnet_eth, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_eth, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3eth___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_eth, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_ip(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return o; } static void __pyx_tp_dealloc_4dnet_ip(PyObject *o) { struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_2ip___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_ip(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return 0; } static int __pyx_tp_clear_4dnet_ip(PyObject *o) { struct __pyx_obj_4dnet_ip *p = (struct __pyx_obj_4dnet_ip *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_ip[] = { {"send", (PyCFunction)__pyx_f_4dnet_2ip_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2ip_send}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_ip = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_ip = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_ip = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_ip = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_ip = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.ip", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_ip), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_ip, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_ip, /*tp_as_number*/ &__pyx_tp_as_sequence_ip, /*tp_as_sequence*/ &__pyx_tp_as_mapping_ip, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ip, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "ip() -> Raw IP object\n\n Open a raw IP socket for sending.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_ip, /*tp_traverse*/ __pyx_tp_clear_4dnet_ip, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_ip, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_2ip___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_ip, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_addr(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return o; } static void __pyx_tp_dealloc_4dnet_addr(PyObject *o) { struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_addr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return 0; } static int __pyx_tp_clear_4dnet_addr(PyObject *o) { struct __pyx_obj_4dnet_addr *p = (struct __pyx_obj_4dnet_addr *)o; return 0; } static PyObject *__pyx_getprop_4dnet_4addr_type(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4type___get__(o); } static int __pyx_setprop_4dnet_4addr_type(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_4type___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_bits(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4bits___get__(o); } static int __pyx_setprop_4dnet_4addr_bits(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_4bits___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_data(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_4data___get__(o); } static PyObject *__pyx_getprop_4dnet_4addr_eth(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_3eth___get__(o); } static int __pyx_setprop_4dnet_4addr_eth(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_3eth___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_ip(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_2ip___get__(o); } static int __pyx_setprop_4dnet_4addr_ip(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_2ip___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_4dnet_4addr_ip6(PyObject *o, void *x) { return __pyx_f_4dnet_4addr_3ip6___get__(o); } static int __pyx_setprop_4dnet_4addr_ip6(PyObject *o, PyObject *v, void *x) { if (v) { return __pyx_f_4dnet_4addr_3ip6___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static struct PyMethodDef __pyx_methods_4dnet_addr[] = { {"bcast", (PyCFunction)__pyx_f_4dnet_4addr_bcast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4addr_bcast}, {"net", (PyCFunction)__pyx_f_4dnet_4addr_net, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4addr_net}, {"__copy__", (PyCFunction)__pyx_f_4dnet_4addr___copy__, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_4dnet_addr[] = { {"type", __pyx_getprop_4dnet_4addr_type, __pyx_setprop_4dnet_4addr_type, __pyx_k1, 0}, {"bits", __pyx_getprop_4dnet_4addr_bits, __pyx_setprop_4dnet_4addr_bits, __pyx_k2, 0}, {"data", __pyx_getprop_4dnet_4addr_data, 0, __pyx_k3, 0}, {"eth", __pyx_getprop_4dnet_4addr_eth, __pyx_setprop_4dnet_4addr_eth, __pyx_k4, 0}, {"ip", __pyx_getprop_4dnet_4addr_ip, __pyx_setprop_4dnet_4addr_ip, __pyx_k5, 0}, {"ip6", __pyx_getprop_4dnet_4addr_ip6, __pyx_setprop_4dnet_4addr_ip6, __pyx_k6, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_addr = { __pyx_f_4dnet_4addr___add__, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ __pyx_f_4dnet_4addr___int__, /*nb_int*/ __pyx_f_4dnet_4addr___long__, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_addr = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_f_4dnet_4addr___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_addr = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_addr = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_addr = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.addr", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_addr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_addr, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ __pyx_f_4dnet_4addr___cmp__, /*tp_compare*/ __pyx_f_4dnet_4addr___repr__, /*tp_repr*/ &__pyx_tp_as_number_addr, /*tp_as_number*/ &__pyx_tp_as_sequence_addr, /*tp_as_sequence*/ &__pyx_tp_as_mapping_addr, /*tp_as_mapping*/ __pyx_f_4dnet_4addr___hash__, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_addr, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "addr(addrtxt=None, type=ADDR_TYPE_NONE) -> network address object\n\n Create a network address object, optionally initialized from a\n human-readable Ethernet, IP, or IPv6 address string.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_addr, /*tp_traverse*/ __pyx_tp_clear_4dnet_addr, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_4addr___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_addr, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_4dnet_addr, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4addr___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_addr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet___addr_ip4_iter(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return o; } static void __pyx_tp_dealloc_4dnet___addr_ip4_iter(PyObject *o) { struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet___addr_ip4_iter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return 0; } static int __pyx_tp_clear_4dnet___addr_ip4_iter(PyObject *o) { struct __pyx_obj_4dnet___addr_ip4_iter *p = (struct __pyx_obj_4dnet___addr_ip4_iter *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet___addr_ip4_iter[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number___addr_ip4_iter = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence___addr_ip4_iter = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping___addr_ip4_iter = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer___addr_ip4_iter = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet___addr_ip4_iter = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.__addr_ip4_iter", /*tp_name*/ sizeof(struct __pyx_obj_4dnet___addr_ip4_iter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet___addr_ip4_iter, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number___addr_ip4_iter, /*tp_as_number*/ &__pyx_tp_as_sequence___addr_ip4_iter, /*tp_as_sequence*/ &__pyx_tp_as_mapping___addr_ip4_iter, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer___addr_ip4_iter, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4dnet___addr_ip4_iter, /*tp_traverse*/ __pyx_tp_clear_4dnet___addr_ip4_iter, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ __pyx_f_4dnet_15__addr_ip4_iter___next__, /*tp_iternext*/ __pyx_methods_4dnet___addr_ip4_iter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_15__addr_ip4_iter___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet___addr_ip4_iter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_arp(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return o; } static void __pyx_tp_dealloc_4dnet_arp(PyObject *o) { struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3arp___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_arp(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return 0; } static int __pyx_tp_clear_4dnet_arp(PyObject *o) { struct __pyx_obj_4dnet_arp *p = (struct __pyx_obj_4dnet_arp *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_arp[] = { {"add", (PyCFunction)__pyx_f_4dnet_3arp_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_add}, {"delete", (PyCFunction)__pyx_f_4dnet_3arp_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_delete}, {"get", (PyCFunction)__pyx_f_4dnet_3arp_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_get}, {"loop", (PyCFunction)__pyx_f_4dnet_3arp_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3arp_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_arp = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_arp = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_arp = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_arp = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_arp = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.arp", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_arp), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_arp, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_arp, /*tp_as_number*/ &__pyx_tp_as_sequence_arp, /*tp_as_sequence*/ &__pyx_tp_as_mapping_arp, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_arp, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "arp() -> ARP table object\n\n Open a handle to the system ARP table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_arp, /*tp_traverse*/ __pyx_tp_clear_4dnet_arp, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_3arp___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_arp, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3arp___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_arp, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_intf(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return o; } static void __pyx_tp_dealloc_4dnet_intf(PyObject *o) { struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_4intf___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_intf(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return 0; } static int __pyx_tp_clear_4dnet_intf(PyObject *o) { struct __pyx_obj_4dnet_intf *p = (struct __pyx_obj_4dnet_intf *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_intf[] = { {"get", (PyCFunction)__pyx_f_4dnet_4intf_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get}, {"get_src", (PyCFunction)__pyx_f_4dnet_4intf_get_src, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get_src}, {"get_dst", (PyCFunction)__pyx_f_4dnet_4intf_get_dst, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_get_dst}, {"set", (PyCFunction)__pyx_f_4dnet_4intf_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_set}, {"loop", (PyCFunction)__pyx_f_4dnet_4intf_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4intf_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_intf = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_intf = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_intf = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_intf = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_intf = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.intf", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_intf), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_intf, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_intf, /*tp_as_number*/ &__pyx_tp_as_sequence_intf, /*tp_as_sequence*/ &__pyx_tp_as_mapping_intf, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_intf, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "intf() -> Interface table object\n\n Open a handle to the system network interface table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_intf, /*tp_traverse*/ __pyx_tp_clear_4dnet_intf, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_4intf___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_intf, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4intf___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_intf, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_route(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return o; } static void __pyx_tp_dealloc_4dnet_route(PyObject *o) { struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_5route___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_route(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return 0; } static int __pyx_tp_clear_4dnet_route(PyObject *o) { struct __pyx_obj_4dnet_route *p = (struct __pyx_obj_4dnet_route *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_route[] = { {"add", (PyCFunction)__pyx_f_4dnet_5route_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_add}, {"delete", (PyCFunction)__pyx_f_4dnet_5route_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_delete}, {"get", (PyCFunction)__pyx_f_4dnet_5route_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_get}, {"loop", (PyCFunction)__pyx_f_4dnet_5route_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_5route_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_route = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_route = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_route = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_route = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_route = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.route", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_route), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_route, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_route, /*tp_as_number*/ &__pyx_tp_as_sequence_route, /*tp_as_sequence*/ &__pyx_tp_as_mapping_route, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_route, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "route() -> Routing table object\n\n Open a handle to the system routing table.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_route, /*tp_traverse*/ __pyx_tp_clear_4dnet_route, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_5route___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_route, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_5route___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_route, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_fw(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return o; } static void __pyx_tp_dealloc_4dnet_fw(PyObject *o) { struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_2fw___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_fw(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return 0; } static int __pyx_tp_clear_4dnet_fw(PyObject *o) { struct __pyx_obj_4dnet_fw *p = (struct __pyx_obj_4dnet_fw *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_fw[] = { {"add", (PyCFunction)__pyx_f_4dnet_2fw_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_add}, {"delete", (PyCFunction)__pyx_f_4dnet_2fw_delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_delete}, {"loop", (PyCFunction)__pyx_f_4dnet_2fw_loop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_2fw_loop}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_fw = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_fw = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_fw = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_fw = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_fw = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.fw", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_fw), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_fw, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_fw, /*tp_as_number*/ &__pyx_tp_as_sequence_fw, /*tp_as_sequence*/ &__pyx_tp_as_mapping_fw, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_fw, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "fw() -> Firewall ruleset object\n \n Open a handle to the local network firewall configuration.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_fw, /*tp_traverse*/ __pyx_tp_clear_4dnet_fw, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_2fw___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_fw, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_2fw___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_fw, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_rand(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return o; } static void __pyx_tp_dealloc_4dnet_rand(PyObject *o) { struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_4rand___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_rand(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return 0; } static int __pyx_tp_clear_4dnet_rand(PyObject *o) { struct __pyx_obj_4dnet_rand *p = (struct __pyx_obj_4dnet_rand *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet_rand[] = { {"get", (PyCFunction)__pyx_f_4dnet_4rand_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_get}, {"set", (PyCFunction)__pyx_f_4dnet_4rand_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_set}, {"add", (PyCFunction)__pyx_f_4dnet_4rand_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_add}, {"uint8", (PyCFunction)__pyx_f_4dnet_4rand_uint8, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint8}, {"uint16", (PyCFunction)__pyx_f_4dnet_4rand_uint16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint16}, {"uint32", (PyCFunction)__pyx_f_4dnet_4rand_uint32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_uint32}, {"xrange", (PyCFunction)__pyx_f_4dnet_4rand_xrange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_4rand_xrange}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_rand = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_rand = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_rand = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_rand = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_rand = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.rand", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_rand), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_rand, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_rand, /*tp_as_number*/ &__pyx_tp_as_sequence_rand, /*tp_as_sequence*/ &__pyx_tp_as_mapping_rand, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_rand, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "rand() -> Pseudo-random number generator\n\n Obtain a handle for fast, cryptographically strong pseudo-random\n number generation. The starting seed is derived from the system\n random data source device (if one exists), or from the current time\n and random stack contents.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_rand, /*tp_traverse*/ __pyx_tp_clear_4dnet_rand, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_rand, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_4rand___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_rand, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet___rand_xrange(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return o; } static void __pyx_tp_dealloc_4dnet___rand_xrange(PyObject *o) { struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet___rand_xrange(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return 0; } static int __pyx_tp_clear_4dnet___rand_xrange(PyObject *o) { struct __pyx_obj_4dnet___rand_xrange *p = (struct __pyx_obj_4dnet___rand_xrange *)o; return 0; } static struct PyMethodDef __pyx_methods_4dnet___rand_xrange[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number___rand_xrange = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence___rand_xrange = { __pyx_f_4dnet_13__rand_xrange___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping___rand_xrange = { __pyx_f_4dnet_13__rand_xrange___len__, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer___rand_xrange = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet___rand_xrange = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.__rand_xrange", /*tp_name*/ sizeof(struct __pyx_obj_4dnet___rand_xrange), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet___rand_xrange, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number___rand_xrange, /*tp_as_number*/ &__pyx_tp_as_sequence___rand_xrange, /*tp_as_sequence*/ &__pyx_tp_as_mapping___rand_xrange, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer___rand_xrange, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_4dnet___rand_xrange, /*tp_traverse*/ __pyx_tp_clear_4dnet___rand_xrange, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_f_4dnet_13__rand_xrange___iter__, /*tp_iter*/ __pyx_f_4dnet_13__rand_xrange___next__, /*tp_iternext*/ __pyx_methods_4dnet___rand_xrange, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_13__rand_xrange___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet___rand_xrange, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static PyObject *__pyx_tp_new_4dnet_tun(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return o; } static void __pyx_tp_dealloc_4dnet_tun(PyObject *o) { struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++o->ob_refcnt; __pyx_f_4dnet_3tun___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_4dnet_tun(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return 0; } static int __pyx_tp_clear_4dnet_tun(PyObject *o) { struct __pyx_obj_4dnet_tun *p = (struct __pyx_obj_4dnet_tun *)o; return 0; } static PyObject *__pyx_getprop_4dnet_3tun_name(PyObject *o, void *x) { return __pyx_f_4dnet_3tun_4name___get__(o); } static PyObject *__pyx_getprop_4dnet_3tun_fd(PyObject *o, void *x) { return __pyx_f_4dnet_3tun_2fd___get__(o); } static struct PyMethodDef __pyx_methods_4dnet_tun[] = { {"fileno", (PyCFunction)__pyx_f_4dnet_3tun_fileno, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_fileno}, {"send", (PyCFunction)__pyx_f_4dnet_3tun_send, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_send}, {"recv", (PyCFunction)__pyx_f_4dnet_3tun_recv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_3tun_recv}, {"close", (PyCFunction)__pyx_f_4dnet_3tun_close, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_4dnet_tun[] = { {"name", __pyx_getprop_4dnet_3tun_name, 0, __pyx_k7, 0}, {"fd", __pyx_getprop_4dnet_3tun_fd, 0, __pyx_k8, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_tun = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ 0, /*nb_divide*/ 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ 0, /*nb_coerce*/ 0, /*nb_int*/ 0, /*nb_long*/ 0, /*nb_float*/ 0, /*nb_oct*/ 0, /*nb_hex*/ 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ }; static PySequenceMethods __pyx_tp_as_sequence_tun = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_tun = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_tun = { 0, /*bf_getreadbuffer*/ 0, /*bf_getwritebuffer*/ 0, /*bf_getsegcount*/ 0, /*bf_getcharbuffer*/ }; PyTypeObject __pyx_type_4dnet_tun = { PyObject_HEAD_INIT(0) 0, /*ob_size*/ "dnet.tun", /*tp_name*/ sizeof(struct __pyx_obj_4dnet_tun), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_4dnet_tun, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ &__pyx_tp_as_number_tun, /*tp_as_number*/ &__pyx_tp_as_sequence_tun, /*tp_as_sequence*/ &__pyx_tp_as_mapping_tun, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_tun, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "tun(src, dst[, mtu]) -> Network tunnel interface handle\n \n Obtain a handle to a network tunnel interface, to which packets\n destined for dst are delivered (with source addresses rewritten to\n src), where they may be read by a userland process and processed\n as desired. Packets written back to the handle are injected into\n the kernel networking subsystem.\n ", /*tp_doc*/ __pyx_tp_traverse_4dnet_tun, /*tp_traverse*/ __pyx_tp_clear_4dnet_tun, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_4dnet_tun, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_4dnet_tun, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_f_4dnet_3tun___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_4dnet_tun, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ }; static struct PyMethodDef __pyx_methods[] = { {"__iter_append", (PyCFunction)__pyx_f_4dnet___iter_append, METH_VARARGS|METH_KEYWORDS, 0}, {"eth_ntoa", (PyCFunction)__pyx_f_4dnet_eth_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_ntoa}, {"eth_aton", (PyCFunction)__pyx_f_4dnet_eth_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_aton}, {"eth_pack_hdr", (PyCFunction)__pyx_f_4dnet_eth_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_eth_pack_hdr}, {"ip_ntoa", (PyCFunction)__pyx_f_4dnet_ip_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_ntoa}, {"ip_aton", (PyCFunction)__pyx_f_4dnet_ip_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_aton}, {"ip_checksum", (PyCFunction)__pyx_f_4dnet_ip_checksum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_checksum}, {"ip_cksum_add", (PyCFunction)__pyx_f_4dnet_ip_cksum_add, METH_VARARGS|METH_KEYWORDS, 0}, {"ip_cksum_carry", (PyCFunction)__pyx_f_4dnet_ip_cksum_carry, METH_VARARGS|METH_KEYWORDS, 0}, {"ip_pack_hdr", (PyCFunction)__pyx_f_4dnet_ip_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip_pack_hdr}, {"ip6_ntoa", (PyCFunction)__pyx_f_4dnet_ip6_ntoa, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_ntoa}, {"ip6_aton", (PyCFunction)__pyx_f_4dnet_ip6_aton, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_aton}, {"ip6_checksum", (PyCFunction)__pyx_f_4dnet_ip6_checksum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_checksum}, {"ip6_pack_hdr", (PyCFunction)__pyx_f_4dnet_ip6_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_ip6_pack_hdr}, {"arp_pack_hdr_ethip", (PyCFunction)__pyx_f_4dnet_arp_pack_hdr_ethip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_arp_pack_hdr_ethip}, {"icmp_pack_hdr", (PyCFunction)__pyx_f_4dnet_icmp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_icmp_pack_hdr}, {"tcp_pack_hdr", (PyCFunction)__pyx_f_4dnet_tcp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_tcp_pack_hdr}, {"udp_pack_hdr", (PyCFunction)__pyx_f_4dnet_udp_pack_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4dnet_udp_pack_hdr}, {0, 0, 0, 0} }; static void __pyx_init_filenames(void); /*proto*/ PyMODINIT_FUNC initdnet(void); /*proto*/ PyMODINIT_FUNC initdnet(void) { PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; PyObject *__pyx_4 = 0; PyObject *__pyx_5 = 0; PyObject *__pyx_6 = 0; PyObject *__pyx_7 = 0; PyObject *__pyx_8 = 0; PyObject *__pyx_9 = 0; PyObject *__pyx_10 = 0; PyObject *__pyx_11 = 0; PyObject *__pyx_12 = 0; PyObject *__pyx_13 = 0; PyObject *__pyx_14 = 0; PyObject *__pyx_15 = 0; PyObject *__pyx_16 = 0; PyObject *__pyx_17 = 0; PyObject *__pyx_18 = 0; PyObject *__pyx_19 = 0; PyObject *__pyx_20 = 0; PyObject *__pyx_21 = 0; PyObject *__pyx_22 = 0; PyObject *__pyx_23 = 0; PyObject *__pyx_24 = 0; PyObject *__pyx_25 = 0; PyObject *__pyx_26 = 0; PyObject *__pyx_27 = 0; PyObject *__pyx_28 = 0; PyObject *__pyx_29 = 0; PyObject *__pyx_30 = 0; PyObject *__pyx_31 = 0; __pyx_init_filenames(); __pyx_m = Py_InitModule4("dnet", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; __pyx_b = PyImport_AddModule("__builtin__"); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}; if (PyType_Ready(&__pyx_type_4dnet_eth) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "eth", (PyObject *)&__pyx_type_4dnet_eth) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} __pyx_ptype_4dnet_eth = &__pyx_type_4dnet_eth; if (PyType_Ready(&__pyx_type_4dnet_ip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "ip", (PyObject *)&__pyx_type_4dnet_ip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} __pyx_ptype_4dnet_ip = &__pyx_type_4dnet_ip; if (PyType_Ready(&__pyx_type_4dnet_addr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "addr", (PyObject *)&__pyx_type_4dnet_addr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} __pyx_ptype_4dnet_addr = &__pyx_type_4dnet_addr; if (PyType_Ready(&__pyx_type_4dnet___addr_ip4_iter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "__addr_ip4_iter", (PyObject *)&__pyx_type_4dnet___addr_ip4_iter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;} __pyx_ptype_4dnet___addr_ip4_iter = &__pyx_type_4dnet___addr_ip4_iter; if (PyType_Ready(&__pyx_type_4dnet_arp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "arp", (PyObject *)&__pyx_type_4dnet_arp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} __pyx_ptype_4dnet_arp = &__pyx_type_4dnet_arp; if (PyType_Ready(&__pyx_type_4dnet_intf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "intf", (PyObject *)&__pyx_type_4dnet_intf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;} __pyx_ptype_4dnet_intf = &__pyx_type_4dnet_intf; if (PyType_Ready(&__pyx_type_4dnet_route) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "route", (PyObject *)&__pyx_type_4dnet_route) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} __pyx_ptype_4dnet_route = &__pyx_type_4dnet_route; if (PyType_Ready(&__pyx_type_4dnet_fw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "fw", (PyObject *)&__pyx_type_4dnet_fw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;} __pyx_ptype_4dnet_fw = &__pyx_type_4dnet_fw; if (PyType_Ready(&__pyx_type_4dnet_rand) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "rand", (PyObject *)&__pyx_type_4dnet_rand) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} __pyx_ptype_4dnet_rand = &__pyx_type_4dnet_rand; if (PyType_Ready(&__pyx_type_4dnet___rand_xrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "__rand_xrange", (PyObject *)&__pyx_type_4dnet___rand_xrange) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} __pyx_ptype_4dnet___rand_xrange = &__pyx_type_4dnet___rand_xrange; if (PyType_Ready(&__pyx_type_4dnet_tun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} if (PyObject_SetAttrString(__pyx_m, "tun", (PyObject *)&__pyx_type_4dnet_tun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} __pyx_ptype_4dnet_tun = &__pyx_type_4dnet_tun; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":15 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___author__, __pyx_k9p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":16 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___copyright__, __pyx_k10p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":17 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___license__, __pyx_n_BSD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":18 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___url__, __pyx_k12p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":19 */ if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k13p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":75 */ __pyx_1 = PyInt_FromLong(6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":76 */ __pyx_1 = PyInt_FromLong(48); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_BITS, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":77 */ __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":78 */ __pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_CRC_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":79 */ __pyx_1 = PyInt_FromLong(14); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_HDR_LEN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":81 */ __pyx_1 = PyInt_FromLong(64); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_LEN_MIN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":82 */ __pyx_1 = PyInt_FromLong(1518); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_LEN_MAX, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":84 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_LEN_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_HDR_LEN); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_3 = PyNumber_Subtract(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_CRC_LEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_MTU, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":85 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_LEN_MIN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_HDR_LEN); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_2 = PyNumber_Subtract(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_CRC_LEN); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} __pyx_1 = PyNumber_Subtract(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_MIN, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":87 */ __pyx_2 = PyInt_FromLong(512); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PUP, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":88 */ __pyx_3 = PyInt_FromLong(2048); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_IP, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":89 */ __pyx_1 = PyInt_FromLong(2054); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_ARP, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":90 */ __pyx_2 = PyInt_FromLong(32821); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_REVARP, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":91 */ __pyx_3 = PyInt_FromLong(33024); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_8021Q, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":92 */ __pyx_1 = PyInt_FromLong(34525); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_IPV6, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":93 */ __pyx_2 = PyInt_FromLong(34887); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_MPLS, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":94 */ __pyx_3 = PyInt_FromLong(34888); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_MPLS_MCAST, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":95 */ __pyx_1 = PyInt_FromLong(34915); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PPPOEDISC, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":96 */ __pyx_2 = PyInt_FromLong(34916); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_PPPOE, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":97 */ __pyx_3 = PyInt_FromLong(36864); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_TYPE_LOOPBACK, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":99 */ __pyx_1 = PyString_FromStringAndSize(__pyx_k14,6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":100 */ __pyx_2 = PyString_FromStringAndSize(__pyx_k15,6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":162 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} __pyx_k16 = __pyx_3; __pyx_3 = 0; __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_BROADCAST); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} __pyx_k17 = __pyx_1; __pyx_1 = 0; __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_TYPE_IP); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;} __pyx_k18 = __pyx_2; __pyx_2 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":199 */ __pyx_4 = PyInt_FromLong(4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":200 */ __pyx_4 = PyInt_FromLong(32); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_BITS, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":202 */ __pyx_4 = PyInt_FromLong(20); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_HDR_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":203 */ __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OPT_LEN, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":204 */ __pyx_4 = PyInt_FromLong(40); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OPT_LEN_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":205 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_OPT_LEN_MAX); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} __pyx_6 = PyNumber_Add(__pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_HDR_LEN_MAX, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":207 */ __pyx_4 = PyInt_FromLong(65535); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_LEN_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":208 */ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_LEN_MIN, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":210 */ __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TOS_DEFAULT, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":212 */ __pyx_4 = PyInt_FromLong(32768); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_RF, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":213 */ __pyx_5 = PyInt_FromLong(16384); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_DF, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":214 */ __pyx_6 = PyInt_FromLong(8192); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_MF, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":215 */ __pyx_4 = PyInt_FromLong(8191); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_OFFMASK, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":217 */ __pyx_5 = PyInt_FromLong(64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TTL_DEFAULT, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":218 */ __pyx_6 = PyInt_FromLong(255); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_TTL_MAX, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":220 */ __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IP, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":221 */ __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ICMP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":222 */ __pyx_6 = PyInt_FromLong(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IGMP, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":223 */ __pyx_4 = PyInt_FromLong(6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_TCP, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":224 */ __pyx_5 = PyInt_FromLong(17); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_UDP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":225 */ __pyx_6 = PyInt_FromLong(41); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_IPV6, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":226 */ __pyx_4 = PyInt_FromLong(47); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_GRE, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":227 */ __pyx_5 = PyInt_FromLong(50); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ESP, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":228 */ __pyx_6 = PyInt_FromLong(51); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_AH, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":229 */ __pyx_4 = PyInt_FromLong(58); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_ICMPV6, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":230 */ __pyx_5 = PyInt_FromLong(255); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_RAW, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":231 */ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_RAW); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_RESERVED, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":232 */ __pyx_4 = PyInt_FromLong(255); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_PROTO_MAX, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":234 */ __pyx_5 = PyString_FromStringAndSize(__pyx_k19,4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_ANY, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":235 */ __pyx_6 = PyString_FromStringAndSize(__pyx_k20,4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_BROADCAST, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":236 */ __pyx_4 = PyString_FromStringAndSize(__pyx_k21,4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_LOOPBACK, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":237 */ __pyx_5 = PyString_FromStringAndSize(__pyx_k22,4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_MCAST_ALL, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":238 */ __pyx_6 = PyString_FromStringAndSize(__pyx_k23,4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP_ADDR_MCAST_LOCAL, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":320 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_IP_TOS_DEFAULT); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k24 = __pyx_4; __pyx_4 = 0; __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_IP_HDR_LEN); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k25 = __pyx_5; __pyx_5 = 0; __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k26 = __pyx_6; __pyx_6 = 0; __pyx_7 = PyInt_FromLong(0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} __pyx_k27 = __pyx_7; __pyx_7 = 0; __pyx_8 = __Pyx_GetName(__pyx_m, __pyx_n_IP_TTL_DEFAULT); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} __pyx_k28 = __pyx_8; __pyx_8 = 0; __pyx_9 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_IP); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} __pyx_k29 = __pyx_9; __pyx_9 = 0; __pyx_10 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_k30 = __pyx_10; __pyx_10 = 0; __pyx_11 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} __pyx_k31 = __pyx_11; __pyx_11 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":355 */ __pyx_12 = PyInt_FromLong(16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_LEN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":356 */ __pyx_12 = PyInt_FromLong(128); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_BITS, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":358 */ __pyx_12 = PyInt_FromLong(40); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HDR_LEN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":359 */ __pyx_12 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_HDR_LEN); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_LEN_MIN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":360 */ __pyx_12 = PyInt_FromLong(65535); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_LEN_MAX, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":362 */ __pyx_12 = PyInt_FromLong(1280); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_MTU_MIN, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":364 */ __pyx_12 = PyInt_FromLong(64); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HLIM_DEFAULT, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":365 */ __pyx_12 = PyInt_FromLong(255); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_HLIM_MAX, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":367 */ __pyx_12 = PyString_FromStringAndSize(__pyx_k32,16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":368 */ __pyx_12 = PyString_FromStringAndSize(__pyx_k33,16); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_IP6_ADDR_LOOPBACK, __pyx_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_DECREF(__pyx_12); __pyx_12 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":395 */ __pyx_12 = PyInt_FromLong(0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k34 = __pyx_12; __pyx_12 = 0; __pyx_13 = PyInt_FromLong(0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k35 = __pyx_13; __pyx_13 = 0; __pyx_14 = PyInt_FromLong(0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k36 = __pyx_14; __pyx_14 = 0; __pyx_15 = __Pyx_GetName(__pyx_m, __pyx_n_IP_PROTO_IPV6); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k37 = __pyx_15; __pyx_15 = 0; __pyx_16 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_HLIM_DEFAULT); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} __pyx_k38 = __pyx_16; __pyx_16 = 0; __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} __pyx_k39 = __pyx_17; __pyx_17 = 0; __pyx_18 = __Pyx_GetName(__pyx_m, __pyx_n_IP6_ADDR_UNSPEC); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} __pyx_k40 = __pyx_18; __pyx_18 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":431 */ __pyx_19 = PyInt_FromLong(0); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_NONE, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":432 */ __pyx_19 = PyInt_FromLong(1); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_ETH, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":433 */ __pyx_19 = PyInt_FromLong(2); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_IP, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":434 */ __pyx_19 = PyInt_FromLong(3); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ADDR_TYPE_IP6, __pyx_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;} Py_DECREF(__pyx_19); __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":444 */ Py_INCREF(Py_None); __pyx_k41 = Py_None; __pyx_19 = __Pyx_GetName(__pyx_m, __pyx_n_ADDR_TYPE_NONE); if (!__pyx_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} __pyx_k42 = __pyx_19; __pyx_19 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":666 */ __pyx_20 = PyInt_FromLong(8); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HDR_LEN, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":667 */ __pyx_20 = PyInt_FromLong(20); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_ETHIP_LEN, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":669 */ __pyx_20 = PyInt_FromLong(1); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HRD_ETH, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":670 */ __pyx_20 = PyInt_FromLong(6); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_HRD_IEEE802, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":672 */ __pyx_20 = PyInt_FromLong(2048); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_PRO_IP, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":674 */ __pyx_20 = PyInt_FromLong(1); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REQUEST, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":675 */ __pyx_20 = PyInt_FromLong(2); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REPLY, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":676 */ __pyx_20 = PyInt_FromLong(3); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REVREQUEST, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":677 */ __pyx_20 = PyInt_FromLong(4); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_ARP_OP_REVREPLY, __pyx_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} Py_DECREF(__pyx_20); __pyx_20 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":738 */ Py_INCREF(Py_None); __pyx_k43 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":760 */ __pyx_20 = __Pyx_GetName(__pyx_m, __pyx_n_ARP_OP_REQUEST); if (!__pyx_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} __pyx_k44 = __pyx_20; __pyx_20 = 0; __pyx_21 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC); if (!__pyx_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} __pyx_k45 = __pyx_21; __pyx_21 = 0; __pyx_22 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_22) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} __pyx_k46 = __pyx_22; __pyx_22 = 0; __pyx_23 = __Pyx_GetName(__pyx_m, __pyx_n_ETH_ADDR_UNSPEC); if (!__pyx_23) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} __pyx_k47 = __pyx_23; __pyx_23 = 0; __pyx_24 = __Pyx_GetName(__pyx_m, __pyx_n_IP_ADDR_ANY); if (!__pyx_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} __pyx_k48 = __pyx_24; __pyx_24 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":806 */ __pyx_25 = PyInt_FromLong(20); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_HDR_LEN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":808 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_FIN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":809 */ __pyx_25 = PyInt_FromLong(2); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_SYN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":810 */ __pyx_25 = PyInt_FromLong(4); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_RST, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":811 */ __pyx_25 = PyInt_FromLong(8); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_PUSH, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":812 */ __pyx_25 = PyInt_FromLong(16); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_ACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":813 */ __pyx_25 = PyInt_FromLong(32); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_URG, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":814 */ __pyx_25 = PyInt_FromLong(64); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_ECE, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":815 */ __pyx_25 = PyInt_FromLong(128); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TH_CWR, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":817 */ __pyx_25 = PyInt_FromLong(65535); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_PORT_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":818 */ __pyx_25 = PyInt_FromLong(65535); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_WIN_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":820 */ __pyx_25 = PyInt_FromLong(0); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_EOL, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":821 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_NOP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":822 */ __pyx_25 = PyInt_FromLong(2); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MSS, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":823 */ __pyx_25 = PyInt_FromLong(3); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_WSCALE, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":824 */ __pyx_25 = PyInt_FromLong(4); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SACKOK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":825 */ __pyx_25 = PyInt_FromLong(5); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":826 */ __pyx_25 = PyInt_FromLong(6); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ECHO, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":827 */ __pyx_25 = PyInt_FromLong(7); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ECHOREPLY, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":828 */ __pyx_25 = PyInt_FromLong(8); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TIMESTAMP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":829 */ __pyx_25 = PyInt_FromLong(9); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_POCONN, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":830 */ __pyx_25 = PyInt_FromLong(10); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_POSVC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":831 */ __pyx_25 = PyInt_FromLong(11); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":832 */ __pyx_25 = PyInt_FromLong(12); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CCNEW, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":833 */ __pyx_25 = PyInt_FromLong(13); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CCECHO, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":834 */ __pyx_25 = PyInt_FromLong(14); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ALTSUM, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":835 */ __pyx_25 = PyInt_FromLong(15); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_ALTSUMDATA, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":836 */ __pyx_25 = PyInt_FromLong(16); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SKEETER, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":837 */ __pyx_25 = PyInt_FromLong(17); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_BUBBA, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":838 */ __pyx_25 = PyInt_FromLong(18); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TRAILSUM, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":839 */ __pyx_25 = PyInt_FromLong(19); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MD5, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":840 */ __pyx_25 = PyInt_FromLong(20); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SCPS, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":841 */ __pyx_25 = PyInt_FromLong(21); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SNACK, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":842 */ __pyx_25 = PyInt_FromLong(22); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_REC, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":843 */ __pyx_25 = PyInt_FromLong(23); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_CORRUPT, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":844 */ __pyx_25 = PyInt_FromLong(24); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_SNAP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":845 */ __pyx_25 = PyInt_FromLong(26); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_TCPCOMP, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":846 */ __pyx_25 = PyInt_FromLong(27); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_TCP_OPT_MAX, __pyx_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_25); __pyx_25 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":848 */ __pyx_25 = PyInt_FromLong(1); if (!__pyx_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k49 = __pyx_25; __pyx_25 = 0; __pyx_26 = PyInt_FromLong(0); if (!__pyx_26) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k50 = __pyx_26; __pyx_26 = 0; __pyx_27 = __Pyx_GetName(__pyx_m, __pyx_n_TH_SYN); if (!__pyx_27) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} __pyx_k51 = __pyx_27; __pyx_27 = 0; __pyx_28 = __Pyx_GetName(__pyx_m, __pyx_n_TCP_WIN_MAX); if (!__pyx_28) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_k52 = __pyx_28; __pyx_28 = 0; __pyx_29 = PyInt_FromLong(0); if (!__pyx_29) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} __pyx_k53 = __pyx_29; __pyx_29 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":871 */ __pyx_30 = PyInt_FromLong(8); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_UDP_HDR_LEN, __pyx_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} Py_DECREF(__pyx_30); __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":872 */ __pyx_30 = PyInt_FromLong(65535); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_UDP_PORT_MAX, __pyx_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;} Py_DECREF(__pyx_30); __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":874 */ __pyx_30 = __Pyx_GetName(__pyx_m, __pyx_n_UDP_HDR_LEN); if (!__pyx_30) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;} __pyx_k54 = __pyx_30; __pyx_30 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":913 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_OTHER, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":914 */ __pyx_31 = PyInt_FromLong(6); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_ETH, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":915 */ __pyx_31 = PyInt_FromLong(24); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_LOOPBACK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":916 */ __pyx_31 = PyInt_FromLong(53); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_TYPE_TUN, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":918 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_UP, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":919 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_LOOPBACK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":920 */ __pyx_31 = PyInt_FromLong(4); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_POINTOPOINT, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":921 */ __pyx_31 = PyInt_FromLong(8); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_NOARP, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":922 */ __pyx_31 = PyInt_FromLong(16); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_BROADCAST, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":923 */ __pyx_31 = PyInt_FromLong(32); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_INTF_FLAG_MULTICAST, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1038 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1137 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1183 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_OP_ALLOW, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1184 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_OP_BLOCK, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1186 */ __pyx_31 = PyInt_FromLong(1); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_DIR_IN, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1187 */ __pyx_31 = PyInt_FromLong(2); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_FW_DIR_OUT, __pyx_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} Py_DECREF(__pyx_31); __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1273 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1371 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1490 */ __pyx_31 = PyInt_FromLong(1500); if (!__pyx_31) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} __pyx_k59 = __pyx_31; __pyx_31 = 0; /* "/Users/dugsong/projects/libdnet/python/dnet.pyx":1531 */ return; __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_5); Py_XDECREF(__pyx_6); Py_XDECREF(__pyx_7); Py_XDECREF(__pyx_8); Py_XDECREF(__pyx_9); Py_XDECREF(__pyx_10); Py_XDECREF(__pyx_11); Py_XDECREF(__pyx_12); Py_XDECREF(__pyx_13); Py_XDECREF(__pyx_14); Py_XDECREF(__pyx_15); Py_XDECREF(__pyx_16); Py_XDECREF(__pyx_17); Py_XDECREF(__pyx_18); Py_XDECREF(__pyx_19); Py_XDECREF(__pyx_20); Py_XDECREF(__pyx_21); Py_XDECREF(__pyx_22); Py_XDECREF(__pyx_23); Py_XDECREF(__pyx_24); Py_XDECREF(__pyx_25); Py_XDECREF(__pyx_26); Py_XDECREF(__pyx_27); Py_XDECREF(__pyx_28); Py_XDECREF(__pyx_29); Py_XDECREF(__pyx_30); Py_XDECREF(__pyx_31); __Pyx_AddTraceback("dnet"); } static char *__pyx_filenames[] = { "dnet.pyx", }; /* Runtime support code */ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Argument '%s' has incorrect type (expected %s, got %s)", name, type->tp_name, obj->ob_type->tp_name); return 0; } static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); if (!result) PyErr_SetObject(PyExc_NameError, name); return result; } static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); } /* Next, repeatedly, replace a tuple exception with its first item */ while (PyTuple_Check(type) && PyTuple_Size(type) > 0) { PyObject *tmp = type; type = PyTuple_GET_ITEM(type, 0); Py_INCREF(type); Py_DECREF(tmp); } if (PyString_CheckExact(type)) { /* Raising builtin string is deprecated but still allowed -- * do nothing. Raising an instance of a new-style str * subclass is right out. */ if (PyErr_Warn(PyExc_DeprecationWarning, "raising a string exception is deprecated")) goto raise_error; } else if (PyType_Check(type) || PyClass_Check(type)) ; /* PyErr_NormalizeException(&type, &value, &tb); */ else if (PyInstance_Check(type)) { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } else { /* Normalize to raise , */ Py_DECREF(value); value = type; type = (PyObject*) ((PyInstanceObject*)type)->in_class; Py_INCREF(type); } } else if (PyType_IsSubtype(type->ob_type, (PyTypeObject*)PyExc_Exception)) { /* Raising a new-style object (in Py2.5). The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } else { /* Normalize to raise , */ Py_DECREF(value); value = type; type = (PyObject*) type->ob_type; Py_INCREF(type); } } else { /* Not something you can raise. You get an exception anyway, just not what you specified :-) */ PyErr_Format(PyExc_TypeError, "exceptions must be classes, instances, or " "strings (deprecated), not %s", type->ob_type->tp_name); goto raise_error; } PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if (obj == Py_None || PyObject_TypeCheck(obj, type)) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", obj->ob_type->tp_name, type->tp_name); return 0; } static void __Pyx_UnpackError(void) { PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } static PyObject *__Pyx_UnpackItem(PyObject *seq, Py_ssize_t i) { PyObject *item; if (!(item = PySequence_GetItem(seq, i))) { if (PyErr_ExceptionMatches(PyExc_IndexError)) __Pyx_UnpackError(); } return item; } static int __Pyx_EndUnpack(PyObject *seq, Py_ssize_t i) { PyObject *item; if (item = PySequence_GetItem(seq, i)) { Py_DECREF(item); __Pyx_UnpackError(); return -1; } PyErr_Clear(); return 0; } static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { while (t->p) { *t->p = PyString_InternFromString(t->s); if (!*t->p) return -1; ++t; } return 0; } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); if (!*t->p) return -1; ++t; } return 0; } #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; PyObject *empty_tuple = 0; PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_srcfile = PyString_FromString(__pyx_filename); if (!py_srcfile) goto bad; py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; empty_tuple = PyTuple_New(0); if (!empty_tuple) goto bad; empty_string = PyString_FromString(""); if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ empty_string, /*PyObject *code,*/ empty_tuple, /*PyObject *consts,*/ empty_tuple, /*PyObject *names,*/ empty_tuple, /*PyObject *varnames,*/ empty_tuple, /*PyObject *freevars,*/ empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = __pyx_lineno; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); Py_XDECREF(empty_tuple); Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } libdnet-1.12/trunk/python/dnet.pyx0000644000076500007650000013763410554377551020440 0ustar dugsongdugsong00000000000000# # dnet.pyx # # $Id: dnet.pyx 638 2007-01-20 11:39:21Z dugsong $ """dumb networking library This module provides a simplified interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. """ __author__ = 'Dug Song ' __copyright__ = 'Copyright (c) 2003 Dug Song' __license__ = 'BSD' __url__ = 'http://libdnet.sourceforge.net/' __version__ = '1.12' cdef extern from "dnet.h": pass cdef extern from "Python.h": object PyString_FromStringAndSize(char *s, int len) int PyString_Size(object o) int PyObject_AsReadBuffer(object o, char **pp, int *lenp) int PyInt_Check(object o) int PyLong_Check(object o) long PyInt_AsLong(object o) unsigned long PyLong_AsUnsignedLong(object o) cdef extern from *: char *malloc(int size) void free(void *p) void *memcpy(char *dst, char *src, int len) void *memset(char *b, int c, int len) char *strerror(int errnum) int strlcpy(char *dst, char *src, int size) unsigned long htonl(unsigned long n) unsigned long ntohl(unsigned long n) cdef __memcpy(char *dst, object src, int n): if PyString_Size(src) != n: raise ValueError, "not a %d-byte binary string: %r" % (n, src) memcpy(dst, src, n) cdef __oserror(): cdef extern int errno return strerror(errno) def __iter_append(entry, l): l.append(entry) # # eth.h # cdef extern from *: ctypedef struct eth_t: int __xxx ctypedef struct eth_addr_t: char data[6] eth_t *eth_open(char *device) int eth_get(eth_t *eth, eth_addr_t *ea) int eth_set(eth_t *eth, eth_addr_t *ea) int eth_send(eth_t *eth, char *buf, int len) eth_t *eth_close(eth_t *eth) char *__eth_ntoa "eth_ntoa" (eth_addr_t *buf) int __eth_aton "eth_aton" (char *src, eth_addr_t *dst) void __eth_pack_hdr "eth_pack_hdr" (char *h, eth_addr_t dst, eth_addr_t src, int type) ETH_ADDR_LEN = 6 ETH_ADDR_BITS = 48 ETH_TYPE_LEN = 2 ETH_CRC_LEN = 4 ETH_HDR_LEN = 14 ETH_LEN_MIN = 64 # /* minimum frame length with CRC */ ETH_LEN_MAX = 1518 # /* maximum frame length with CRC */ ETH_MTU = (ETH_LEN_MAX - ETH_HDR_LEN - ETH_CRC_LEN) ETH_MIN = (ETH_LEN_MIN - ETH_HDR_LEN - ETH_CRC_LEN) ETH_TYPE_PUP = 0x0200 # /* PUP protocol */ ETH_TYPE_IP = 0x0800 # /* IP protocol */ ETH_TYPE_ARP = 0x0806 # /* address resolution protocol */ ETH_TYPE_REVARP=0x8035 # /* reverse addr resolution protocol */ ETH_TYPE_8021Q =0x8100 # /* IEEE 802.1Q VLAN tagging */ ETH_TYPE_IPV6 = 0x86DD # /* IPv6 protocol */ ETH_TYPE_MPLS = 0x8847 # /* MPLS */ ETH_TYPE_MPLS_MCAST = 0x8848 # /* MPLS Multicast */ ETH_TYPE_PPPOEDISC = 0x8863 # /* PPP Over Ethernet Discovery Stage */ ETH_TYPE_PPPOE = 0x8864 # /* PPP Over Ethernet Session Stage */ ETH_TYPE_LOOPBACK = 0x9000 # /* used to test interfaces */ ETH_ADDR_UNSPEC = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00", 6) ETH_ADDR_BROADCAST = PyString_FromStringAndSize("\xff\xff\xff\xff\xff\xff", 6) cdef class eth: """eth(device) -> Ethernet device object Open the specified Ethernet device for sending. """ cdef eth_t *eth def __init__(self, device): self.eth = eth_open(device) if not self.eth: raise OSError, __oserror() def get(self): """Return the MAC address associated with the device as a binary string.""" cdef eth_addr_t ea if eth_get(self.eth, &ea) < 0: raise OSError, __oserror() return PyString_FromStringAndSize(ea.data, 6) def set(self, value): """Set the MAC address for the device, returning 0 on success, -1 on failure. Arguments: eth_addr -- 6-byte binary string (e.g. '\\x00\\xde\\xad\\xbe\\xef\\x00') """ cdef eth_addr_t ea __memcpy(ea.data, value, 6) if eth_set(self.eth, &ea) < 0: raise OSError, __oserror() def send(self, frame): """Send an Ethernet frame, returning the number of bytes sent or -1 on failure. Arguments: frame -- binary string representing an Ethernet frame """ return eth_send(self.eth, frame, PyString_Size(frame)) def __dealloc__(self): if self.eth: eth_close(self.eth) def eth_ntoa(buf): """Convert an Ethernet MAC address from 6-byte packed binary string to a printable string ('00:de:ad:be:ef:00').""" cdef eth_addr_t ea __memcpy(ea.data, buf, 6) return __eth_ntoa(&ea) def eth_aton(buf): """Convert an Ethernet MAC address from a printable string to a packed binary string ('\\x00\\xde\\xad\\xbe\\xef\\x00').""" cdef eth_addr_t ea if __eth_aton(buf, &ea) < 0: raise ValueError, "invalid Ethernet address" return PyString_FromStringAndSize(ea.data, 6) def eth_pack_hdr(dst=ETH_ADDR_BROADCAST, src=ETH_ADDR_BROADCAST, type=ETH_TYPE_IP): """Return a packed binary string representing an Ethernet header. Keyword arguments: dst -- destination address (6-byte binary string) src -- source address (6-byte binary string) type -- Ethernet payload type (ETH_TYPE_*) (16-bit integer) """ cdef char hdr[14] cdef eth_addr_t s, d __memcpy(s.data, src, 6) __memcpy(d.data, dst, 6) __eth_pack_hdr(hdr, d, s, type) return PyString_FromStringAndSize(hdr, 14) # # ip.h # cdef extern from *: ctypedef struct ip_t: int __xxx ctypedef struct ip_addr_t: char data[4] ip_t *ip_open() int ip_send(ip_t *ip, char *buf, int len) ip_t *ip_close(ip_t *ip) char *__ip_ntoa "ip_ntoa" (ip_addr_t *buf) int __ip_aton "ip_aton" (char *src, ip_addr_t *dst) void __ip_checksum "ip_checksum" (char *buf, int len) int __ip_cksum_add "ip_cksum_add" (char *buf, int len, int sum) int __ip_cksum_carry "ip_cksum_carry" (int sum) void __ip_pack_hdr "ip_pack_hdr" (char *h, int tos, int len, int id, int off, int ttl, int p, ip_addr_t s, ip_addr_t d) IP_ADDR_LEN = 4 # /* IP address length */ IP_ADDR_BITS = 32 # /* IP address bits */ IP_HDR_LEN = 20 # /* base IP header length */ IP_OPT_LEN = 2 # /* base IP option length */ IP_OPT_LEN_MAX =40 IP_HDR_LEN_MAX =(IP_HDR_LEN + IP_OPT_LEN_MAX) IP_LEN_MAX = 65535 IP_LEN_MIN = IP_HDR_LEN IP_TOS_DEFAULT =0x00 # /* default */ IP_RF = 0x8000 # /* reserved */ IP_DF = 0x4000 # /* don't fragment */ IP_MF = 0x2000 # /* more fragments (not last frag) */ IP_OFFMASK = 0x1fff # /* mask for fragment offset */ IP_TTL_DEFAULT =64 # /* default ttl, RFC 1122, RFC 1340 */ IP_TTL_MAX = 255 # /* maximum ttl */ IP_PROTO_IP = 0 # /* dummy for IP */ IP_PROTO_ICMP = 1 # /* ICMP */ IP_PROTO_IGMP = 2 # /* IGMP */ IP_PROTO_TCP = 6 # /* TCP */ IP_PROTO_UDP = 17 # /* UDP */ IP_PROTO_IPV6 = 41 # /* IPv6 */ IP_PROTO_GRE = 47 # /* General Routing Encap */ IP_PROTO_ESP = 50 # /* Encap Security Payload */ IP_PROTO_AH = 51 # /* Authentication Header */ IP_PROTO_ICMPV6 = 58 # /* ICMP for IPv6 */ IP_PROTO_RAW = 255 # /* Raw IP packets */ IP_PROTO_RESERVED = IP_PROTO_RAW # /* Reserved */ IP_PROTO_MAX = 255 IP_ADDR_ANY = PyString_FromStringAndSize("\x00\x00\x00\x00", 4) IP_ADDR_BROADCAST = PyString_FromStringAndSize("\xff\xff\xff\xff", 4) IP_ADDR_LOOPBACK = PyString_FromStringAndSize("\x7f\x00\x00\x01", 4) IP_ADDR_MCAST_ALL = PyString_FromStringAndSize("\xe0\x00\x00\x01", 4) IP_ADDR_MCAST_LOCAL = PyString_FromStringAndSize("\xe0\x00\x00\xff", 4) cdef class ip: """ip() -> Raw IP object Open a raw IP socket for sending. """ cdef ip_t *ip def __init__(self): self.ip = ip_open() if not self.ip: raise OSError, __oserror() def send(self, pkt): """Send an IP packet, returning the number of bytes sent or -1 on failure. Arguments: pkt -- binary string representing an IP packet """ return ip_send(self.ip, pkt, PyString_Size(pkt)) def __dealloc__(self): if self.ip: ip_close(self.ip) def ip_ntoa(buf): """Convert an IP address from a 4-byte packed binary string or integer to a printable string ('10.0.0.1').""" cdef ip_addr_t ia cdef unsigned int i if PyInt_Check(buf) or PyLong_Check(buf): i = ntohl(buf) memcpy(&ia, &i, 4) else: __memcpy(&ia, buf, 4) return __ip_ntoa(&ia) def ip_aton(buf): """Convert an IP address from a printable string to a packed binary string ('\\x0a\\x00\\x00\\x01').""" cdef ip_addr_t ia if __ip_aton(buf, &ia) < 0: raise ValueError, "invalid IP address" return PyString_FromStringAndSize(&ia, 4) def ip_checksum(pkt): """Return packed binary string representing an IP packet with the IP and transport-layer checksums set. Arguments: pkt -- binary string representing an IP packet """ cdef char buf[2048] cdef char *p cdef int n if PyObject_AsReadBuffer(pkt, &p, &n) == 0: if n < 2048: memcpy(buf, p, n) __ip_checksum(buf, n) return PyString_FromStringAndSize(buf, n) p = malloc(n) memcpy(p, pkt, n) __ip_checksum(p, n) s = PyString_FromStringAndSize(p, n) free(p) return s raise TypeError def ip_cksum_add(buf, int sum): cdef char *p cdef int n if PyObject_AsReadBuffer(buf, &p, &n) == 0: return __ip_cksum_add(p, n, sum) else: raise TypeError def ip_cksum_carry(int sum): return __ip_cksum_carry(sum) def ip_pack_hdr(tos=IP_TOS_DEFAULT, len=IP_HDR_LEN, id=0, off=0, ttl=IP_TTL_DEFAULT, p=IP_PROTO_IP, src=IP_ADDR_ANY, dst=IP_ADDR_ANY): """Return a packed binary string representing an IP header. Keyword arguments: tos -- type of service (8-bit integer) len -- length (IP_HDR_LEN + payload) (16-bit integer) id -- packet ID (16-bit integer) off -- fragmentation offset (16-bit integer) ttl -- time-to-live (8-bit integer) p -- protocol (IP_PROTO_*) (8-bit integer) src -- source address (4-byte binary string) dst -- destination address (4-byte binary string) """ cdef char hdr[20] cdef ip_addr_t s, d __memcpy(&s, src, 4) __memcpy(&d, dst, 4) __ip_pack_hdr(hdr, tos, len, id, off, ttl, p, s, d) return PyString_FromStringAndSize(hdr, 20) # # ip6.h # cdef extern from *: ctypedef struct ip6_addr_t: char data[16] char *__ip6_ntoa "ip6_ntoa" (ip6_addr_t *buf) int __ip6_aton "ip6_aton" (char *src, ip6_addr_t *dst) void __ip6_checksum "ip6_checksum" (char *buf, int len) void __ip6_pack_hdr "ip6_pack_hdr" (char *h, int fd, int fl, int plen, int nxt, int hlim, ip6_addr_t s, ip6_addr_t d) IP6_ADDR_LEN = 16 IP6_ADDR_BITS = 128 IP6_HDR_LEN = 40 # /* IPv6 header length */ IP6_LEN_MIN = IP6_HDR_LEN IP6_LEN_MAX = 65535 # /* non-jumbo payload */ IP6_MTU_MIN = 1280 # /* minimum MTU (1024 + 256) */ IP6_HLIM_DEFAULT=64 IP6_HLIM_MAX = 255 IP6_ADDR_UNSPEC = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16) IP6_ADDR_LOOPBACK = PyString_FromStringAndSize("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", 16) def ip6_ntoa(buf): """Convert an IPv6 address from a 16-byte packed binary string to a printable string ('10.0.0.1').""" cdef ip6_addr_t ia __memcpy(&ia, buf, 16) return __ip6_ntoa(&ia) def ip6_aton(buf): """Convert an IPv6 address from a printable string to a packed binary string ('\\x0a\\x00\\x00\\x01').""" cdef ip6_addr_t ia if __ip6_aton(buf, &ia) < 0: raise ValueError, "invalid IPv6 address" return PyString_FromStringAndSize(&ia, 16) def ip6_checksum(buf): """Return a packed binary string representing an IPv6 packet with the IPv6 and transport-layer checksums set. Arguments: pkt -- binary string representing an IPv6 packet """ __ip6_checksum(buf, PyString_Size(buf)) return buf def ip6_pack_hdr(fc=0, fl=0, plen=0, nxt=IP_PROTO_IPV6, hlim=IP6_HLIM_DEFAULT, src=IP6_ADDR_UNSPEC, dst=IP6_ADDR_UNSPEC): """Return a packed binary string representing an IPv6 header. Keyword arguments: fc -- flow class (8-bit integer) fl -- flow label (20-bit integer) plen -- payload length (16-bit integer) nxt -- next header (IP_PROTO_*) (8-bit integer) hlim -- hop limit (8-bit integer) src -- source address (16-byte binary string) dst -- destination address (16-byte binary string) """ cdef char hdr[40] cdef ip6_addr_t s, d __memcpy(&s, src, 16) __memcpy(&d, dst, 16) __ip6_pack_hdr(hdr, fc, fl, plen, nxt, hlim, s, d) return PyString_FromStringAndSize(hdr, 40) # # addr.h # cdef extern from *: cdef struct addr_t "addr": unsigned short addr_type unsigned short addr_bits char addr_data8[16] unsigned long addr_ip int addr_cmp(addr_t *a, addr_t *b) int addr_bcast(addr_t *a, addr_t *b) int addr_net(addr_t *a, addr_t *b) char *addr_ntoa(addr_t *a) int addr_aton(char *src, addr_t *dst) ADDR_TYPE_NONE = 0 ADDR_TYPE_ETH = 1 ADDR_TYPE_IP = 2 ADDR_TYPE_IP6 = 3 cdef class addr: """addr(addrtxt=None, type=ADDR_TYPE_NONE) -> network address object Create a network address object, optionally initialized from a human-readable Ethernet, IP, or IPv6 address string. """ cdef addr_t _addr def __init__(self, addrtxt=None, type=ADDR_TYPE_NONE): if addrtxt != None and addr_aton(addrtxt, &self._addr) < 0: if PyString_Size(addrtxt) == 4: self._addr.addr_type = ADDR_TYPE_IP self._addr.addr_bits = IP_ADDR_BITS self.ip = addrtxt else: raise ValueError, "invalid network address" property type: """Address type (ADDR_TYPE_*) integer.""" def __get__(self): return self._addr.addr_type def __set__(self, unsigned int value): if value > 0xffff: raise OverflowError self._addr.addr_type = value property bits: """Address bitlength integer.""" def __get__(self): return self._addr.addr_bits def __set__(self, unsigned int value): if value > 0xffff: raise OverflowError self._addr.addr_bits = value property data: """Raw address string.""" def __get__(self): if self._addr.addr_type == ADDR_TYPE_ETH: return self.eth elif self._addr.addr_type == ADDR_TYPE_IP: return self.ip elif self._addr.addr_type == ADDR_TYPE_IP6: return self.ip6 else: raise ValueError, "invalid network address" property eth: """Ethernet MAC address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_ETH: raise ValueError, "non-Ethernet address" return PyString_FromStringAndSize(self._addr.addr_data8, 6) def __set__(self, value): if PyString_Size(value) != ETH_ADDR_LEN: raise ValueError, "not a 6-byte string" __memcpy(self._addr.addr_data8, value, 6) self._addr.addr_type = ADDR_TYPE_ETH self._addr.addr_bits = ETH_ADDR_BITS property ip: """IPv4 address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_IP: raise ValueError, "non-IP address" return PyString_FromStringAndSize(self._addr.addr_data8, 4) def __set__(self, value): # XXX - handle < 2.3, or else we'd use PyInt_AsUnsignedLongMask() if PyInt_Check(value): self._addr.addr_ip = htonl(PyInt_AsLong(value)) elif PyLong_Check(value): self._addr.addr_ip = htonl(PyLong_AsUnsignedLong(value)) elif PyString_Size(value) != IP_ADDR_LEN: raise ValueError, "not a 4-byte string" else: __memcpy(self._addr.addr_data8, value, 4) self._addr.addr_type = ADDR_TYPE_IP self._addr.addr_bits = IP_ADDR_BITS property ip6: """IPv6 address as binary string.""" def __get__(self): if self._addr.addr_type != ADDR_TYPE_IP6: raise ValueError, "non-IPv6 address" return PyString_FromStringAndSize(self._addr.addr_data8, 16) def __set__(self, value): if PyString_Size(value) != IP6_ADDR_LEN: raise ValueError, "not a 16-byte string" __memcpy(self._addr.addr_data8, value, 16) self._addr.addr_type = ADDR_TYPE_IP6 self._addr.addr_bits = IP6_ADDR_BITS def bcast(self): """Return an addr object for our broadcast address.""" bcast = addr() addr_bcast(&self._addr, &(bcast)._addr) return bcast def net(self): """Return an addr object for our network address.""" net = addr() addr_net(&self._addr, &(net)._addr) return net def __add__(self, other): # XXX - only handle IP for now... if PyInt_Check(self): x, y = other, self elif PyInt_Check(other): x, y = self, other else: raise NotImplementedError z = x.__copy__() (z)._addr.addr_ip = htonl(ntohl((x)._addr.addr_ip) + y) return z def __copy__(self): a = addr() (a)._addr = self._addr return a def __cmp__(addr x, addr y): cdef int i i = addr_cmp(&x._addr, &y._addr) if i < 0: return -1 if i > 0: return 1 return 0 def __contains__(self, addr other): cdef addr_t s1, s2, o1, o2 if addr_net(&self._addr, &s1) != 0 or \ addr_bcast(&self._addr, &s2) != 0 or \ addr_net(&other._addr, &o1) != 0 or \ addr_bcast(&other._addr, &o2) != 0: return 0 return addr_cmp(&o1, &s1) >= 0 and addr_cmp(&o2, &s2) <= 0 def __hash__(self): cdef long x, y, size if self._addr.addr_type == ADDR_TYPE_ETH: size = 6 elif self._addr.addr_type == ADDR_TYPE_IP: size = 4 elif self._addr.addr_type == ADDR_TYPE_IP6: size = 16 x = 0x345678 x = x ^ self._addr.addr_type x = x ^ self._addr.addr_bits y = self._addr.addr_data8[0] << 7 for i from 0 < i < size: y = (1000003 * y) ^ self._addr.addr_data8[i] y = y ^ size if y == -1: y = -2 x = x ^ y if x == -1: x = -2 return x def __int__(self): if self._addr.addr_type != ADDR_TYPE_IP: raise NotImplementedError return ntohl(self._addr.addr_ip) def __long__(self): return self.__int__() def __iter__(self): cdef addr_t a, b if self._addr.addr_type != ADDR_TYPE_IP or \ addr_net(&self._addr, &a) != 0 or \ addr_bcast(&self._addr, &b) != 0: raise ValueError """XXX - i wish! for i in ntohl(a.addr_ip) <= i <= ntohl(b.addr_ip): next = addr() next._addr.addr_type = ADDR_TYPE_IP next._addr.addr_bits = IP_ADDR_BITS next._addr.addr_ip = htonl(i) yield next """ return __addr_ip4_iter(a.addr_ip, b.addr_ip) def __repr__(self): cdef char *p p = addr_ntoa(&self._addr) if not p: return '' return p cdef class __addr_ip4_iter: cdef unsigned long cur # XXX - HBO cdef unsigned long max # XXX - HBO def __init__(self, cur, max): self.cur = ntohl(cur) self.max = ntohl(max) def __next__(self): cdef addr next if (self.cur <= self.max): next = addr() next._addr.addr_type = ADDR_TYPE_IP next._addr.addr_bits = IP_ADDR_BITS next._addr.addr_ip = htonl(self.cur) self.cur = self.cur + 1 return next else: raise StopIteration # # arp.h # cdef extern from *: cdef struct arp_entry: addr_t arp_pa addr_t arp_ha ctypedef struct arp_t: int __xxx ctypedef int (*arp_handler)(arp_entry *entry, void *arg) except -1 arp_t *arp_open() int arp_add(arp_t *arp, arp_entry *entry) int arp_delete(arp_t *arp, arp_entry *entry) int arp_get(arp_t *arp, arp_entry *entry) int arp_loop(arp_t *arp, arp_handler callback, void *arg) arp_t *arp_close(arp_t *arp) void __arp_pack_hdr_ethip "arp_pack_hdr_ethip" (char *buf, int op, eth_addr_t sha, ip_addr_t spa, eth_addr_t dha, ip_addr_t dpa) ARP_HDR_LEN = 8 # /* base ARP header length */ ARP_ETHIP_LEN = 20 # /* base ARP message length */ ARP_HRD_ETH = 0x0001 # /* ethernet hardware */ ARP_HRD_IEEE802=0x0006 # /* IEEE 802 hardware */ ARP_PRO_IP = 0x0800 # /* IP protocol */ ARP_OP_REQUEST = 1 # /* request to resolve ha given pa */ ARP_OP_REPLY = 2 # /* response giving hardware address */ ARP_OP_REVREQUEST = 3 # /* request to resolve pa given ha */ ARP_OP_REVREPLY = 4 # /* response giving protocol address */ cdef int __arp_callback(arp_entry *entry, void *arg) except -1: f, a = arg pa, ha = addr(), addr() (pa)._addr = entry.arp_pa (ha)._addr = entry.arp_ha ret = f((pa, ha), a) if not ret: ret = 0 return ret cdef class arp: """arp() -> ARP table object Open a handle to the system ARP table. """ cdef arp_t *arp def __init__(self): self.arp = arp_open() if not self.arp: raise OSError, __oserror() def add(self, addr pa, addr ha): """Add an entry to the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object ha -- ADDR_TYPE_ETH network address object """ cdef arp_entry entry entry.arp_pa = pa._addr entry.arp_ha = ha._addr if arp_add(self.arp, &entry) < 0: raise OSError, __oserror() def delete(self, addr pa): """Delete an entry from the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object """ cdef arp_entry entry entry.arp_pa = pa._addr if arp_delete(self.arp, &entry) < 0: raise OSError, __oserror() def get(self, addr pa): """Return the hardware address for a given protocol address in the system ARP table. Arguments: pa -- ADDR_TYPE_IP network address object """ cdef arp_entry entry entry.arp_pa = pa._addr if arp_get(self.arp, &entry) == 0: return addr(addr_ntoa(&entry.arp_ha)) return None def loop(self, callback, arg=None): """Iterate over the system ARP table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with ((pa, ha), arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return arp_loop(self.arp, __arp_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.arp: arp_close(self.arp) def arp_pack_hdr_ethip(op=ARP_OP_REQUEST, sha=ETH_ADDR_UNSPEC, spa=IP_ADDR_ANY, dha=ETH_ADDR_UNSPEC, dpa=IP_ADDR_ANY): """Return a packed binary string representing an Ethernet/IP ARP message. Keyword arguments: op -- operation (ARP_OP_*) (16-bit integer) sha -- sender Ethernet address (6-byte binary string) spa -- sender IP address (4-byte binary string) dha -- destination Ethernet address (6-byte binary string) dpa -- destination IP address (4-byte binary string) """ cdef char buf[28] cdef eth_addr_t sh, dh cdef ip_addr_t sp, dp __memcpy(sh.data, sha, 6) __memcpy(dh.data, dha, 6) __memcpy(&sp, spa, 4) __memcpy(&dp, dpa, 4) __arp_pack_hdr_ethip(buf, op, sh, sp, dh, dp) return PyString_FromStringAndSize(buf, 28) # # icmp.h # cdef extern from *: void __icmp_pack_hdr "icmp_pack_hdr" (char *hdr, int type, int code) def icmp_pack_hdr(type, code): """Return a packed binary string representing an ICMP header. Keyword arguments: type -- ICMP type (8-bit integer) code -- ICMP code (8-bit integer) """ cdef char buf[4] __icmp_pack_hdr(buf, type, code) return PyString_FromStringAndSize(buf, sizeof(buf)) # # tcp.h # cdef extern from *: void __tcp_pack_hdr "tcp_pack_hdr" (char *hdr, int sport, int dport, unsigned long seq, unsigned long ack, int flags, int win, int urp) TCP_HDR_LEN = 20 # /* base TCP header length */ TH_FIN = 0x01 # /* end of data */ TH_SYN = 0x02 # /* synchronize sequence numbers */ TH_RST = 0x04 # /* reset connection */ TH_PUSH = 0x08 # /* push */ TH_ACK = 0x10 # /* acknowledgement number set */ TH_URG = 0x20 # /* urgent pointer set */ TH_ECE = 0x40 # /* ECN echo, RFC 3168 */ TH_CWR = 0x80 # /* congestion window reduced */ TCP_PORT_MAX = 65535 # /* maximum port */ TCP_WIN_MAX = 65535 # /* maximum (unscaled) window */ TCP_OPT_EOL = 0 # /* end of option list */ TCP_OPT_NOP = 1 # /* no operation */ TCP_OPT_MSS = 2 # /* maximum segment size */ TCP_OPT_WSCALE = 3 # /* window scale factor, RFC 1072 */ TCP_OPT_SACKOK = 4 # /* SACK permitted, RFC 2018 */ TCP_OPT_SACK = 5 # /* SACK, RFC 2018 */ TCP_OPT_ECHO = 6 # /* echo (obsolete), RFC 1072 */ TCP_OPT_ECHOREPLY = 7 # /* echo reply (obsolete), RFC 1072 */ TCP_OPT_TIMESTAMP = 8 # /* timestamp, RFC 1323 */ TCP_OPT_POCONN = 9 # /* partial order conn, RFC 1693 */ TCP_OPT_POSVC = 10 # /* partial order service, RFC 1693 */ TCP_OPT_CC = 11 # /* connection count, RFC 1644 */ TCP_OPT_CCNEW = 12 # /* CC.NEW, RFC 1644 */ TCP_OPT_CCECHO = 13 # /* CC.ECHO, RFC 1644 */ TCP_OPT_ALTSUM = 14 # /* alt checksum request, RFC 1146 */ TCP_OPT_ALTSUMDATA = 15 # /* alt checksum data, RFC 1146 */ TCP_OPT_SKEETER = 16 # /* Skeeter */ TCP_OPT_BUBBA = 17 # /* Bubba */ TCP_OPT_TRAILSUM = 18 # /* trailer checksum */ TCP_OPT_MD5 = 19 # /* MD5 signature, RFC 2385 */ TCP_OPT_SCPS = 20 # /* SCPS capabilities */ TCP_OPT_SNACK = 21 # /* selective negative acks */ TCP_OPT_REC = 22 # /* record boundaries */ TCP_OPT_CORRUPT = 23 # /* corruption experienced */ TCP_OPT_SNAP = 24 # /* SNAP */ TCP_OPT_TCPCOMP = 26 # /* TCP compression filter */ TCP_OPT_MAX = 27 def tcp_pack_hdr(sport, dport, seq=1, ack=0, flags=TH_SYN, win=TCP_WIN_MAX, urp=0): """Return a packed binary string representing a TCP header. Keyword arguments: sport -- source port (16-bit integer) dport -- destination port (16-bit integer) seq -- sequence number (32-bit integer) ack -- acknowledgment number (32-bit integer) flags -- control flags (TH_*) (8-bit integer bitmask) win -- window size (16-bit integer) urp -- urgent pointer (16-bit integer) """ cdef char buf[20] __tcp_pack_hdr(buf, sport, dport, seq, ack, flags, win, urp) return PyString_FromStringAndSize(buf, sizeof(buf)) # # udp.h # cdef extern from *: void __udp_pack_hdr "udp_pack_hdr" (char *hdr, int sport, int dport, int ulen) UDP_HDR_LEN = 8 UDP_PORT_MAX = 65535 def udp_pack_hdr(sport, dport, ulen=UDP_HDR_LEN): """Return a packed binary string representing a UDP header. Keyword arguments: sport -- source port (16-bit integer) dport -- destination port (16-bit integer) ulen -- UDP header + data length (16-bit integer) """ cdef char buf[8] __udp_pack_hdr(buf, sport, dport, ulen) return PyString_FromStringAndSize(buf, sizeof(buf)) # # intf.h # cdef extern from *: struct intf_entry: unsigned int intf_len char intf_name[16] unsigned short intf_type unsigned short intf_flags unsigned int intf_mtu addr_t intf_addr addr_t intf_dst_addr addr_t intf_link_addr unsigned int intf_alias_num addr_t intf_alias_addrs[8] # XXX ctypedef struct intf_t: int __xxx ctypedef int (*intf_handler)(intf_entry *entry, void *arg) except -1 intf_t *intf_open() int intf_get(intf_t *intf, intf_entry *entry) int intf_get_src(intf_t *intf, intf_entry *entry, addr_t *src) int intf_get_dst(intf_t *intf, intf_entry *entry, addr_t *dst) int intf_set(intf_t *intf, intf_entry *entry) int intf_loop(intf_t *intf, intf_handler callback, void *arg) intf_t *intf_close(intf_t *intf) INTF_TYPE_OTHER = 1 # /* other */ INTF_TYPE_ETH = 6 # /* Ethernet */ INTF_TYPE_LOOPBACK = 24 # /* software loopback */ INTF_TYPE_TUN = 53 # /* proprietary virtual/internal */ INTF_FLAG_UP = 0x01 # /* enable interface */ INTF_FLAG_LOOPBACK = 0x02 # /* is a loopback net (r/o) */ INTF_FLAG_POINTOPOINT = 0x04 # /* point-to-point link (r/o) */ INTF_FLAG_NOARP = 0x08 # /* disable ARP */ INTF_FLAG_BROADCAST = 0x10 # /* supports broadcast (r/o) */ INTF_FLAG_MULTICAST = 0x20 # /* supports multicast (r/o) */ cdef object ifent_to_dict(intf_entry *entry): d = {} d['name'] = entry.intf_name d['type'] = entry.intf_type d['flags'] = entry.intf_flags d['mtu'] = entry.intf_mtu if entry.intf_addr.addr_type != ADDR_TYPE_NONE: d['addr'] = addr(addr_ntoa(&entry.intf_addr)) if entry.intf_dst_addr.addr_type != ADDR_TYPE_NONE: d['dst_addr'] = addr(addr_ntoa(&entry.intf_dst_addr)) if entry.intf_link_addr.addr_type != ADDR_TYPE_NONE: d['link_addr'] = addr(addr_ntoa(&entry.intf_link_addr)) if entry.intf_alias_num > 0: l = [] for i from 0 <= i < entry.intf_alias_num: l.append(addr(addr_ntoa(&entry.intf_alias_addrs[i]))) d['alias_addrs'] = l return d cdef dict_to_ifent(object d, intf_entry *entry): s = d['name'] strlcpy(entry.intf_name, s, 16) if 'flags' in d: entry.intf_flags = d['flags'] if 'mtu' in d: entry.intf_mtu = d['mtu'] if 'addr' in d: entry.intf_addr = (d['addr'])._addr if 'dst_addr' in d: entry.intf_dst_addr = (d['dst_addr'])._addr if 'link_addr' in d: entry.intf_link_addr = (d['link_addr'])._addr if 'alias_addrs' in d: entry.intf_alias_num = len(d['alias_addrs']) for i from 0 <= i < entry.intf_alias_num: entry.intf_alias_addrs[i] = (d['alias_addrs'][i])._addr cdef int __intf_callback(intf_entry *entry, void *arg) except -1: f, a = arg ret = f(ifent_to_dict(entry), a) if not ret: ret = 0 return ret cdef class intf: """intf() -> Interface table object Open a handle to the system network interface table. """ cdef intf_t *intf def __init__(self): self.intf = intf_open() if not self.intf: raise OSError, __oserror() def get(self, name): """Return the configuration for a network interface as a dict. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 strlcpy(ifent.intf_name, name, 16) if intf_get(self.intf, ifent) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def get_src(self, addr src): """Return the configuration for the interface whose primary address matches the specified source address. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 if intf_get_src(self.intf, ifent, &src._addr) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def get_dst(self, addr dst): """Return the configuration for the best interface with which to reach the specified dst address. """ cdef intf_entry *ifent cdef char buf[1024] ifent = buf ifent.intf_len = 1024 if intf_get_dst(self.intf, ifent, &dst._addr) < 0: raise OSError, __oserror() return ifent_to_dict(ifent) def set(self, d): """Set the configuration for an interface from a dict. Dict values: name -- name of interface to set (string) flags -- interface flags (INTF_FLAG_*) (integer bitmask) mtu -- interface MTU (integer) addr -- primary network address (addr object) dst_addr -- point-to-point dst address (addr object) link_addr -- link-layer address (addr object) alias_addrs -- additional network addresses (list of addr objects) """ cdef intf_entry *ifent cdef char buf[1024] memset(buf, 0, sizeof(buf)) ifent = buf ifent.intf_len = 1024 dict_to_ifent(d, ifent) if intf_set(self.intf, ifent) < 0: raise OSError, __oserror() def loop(self, callback, arg=None): """Iterate over the system interface table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with (dict, arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return intf_loop(self.intf, __intf_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.intf: intf_close(self.intf) # # route.h # cdef extern from *: cdef struct route_entry: addr_t route_dst addr_t route_gw ctypedef struct route_t: int __xxx ctypedef int (*route_handler)(route_entry *entry, void *arg) except -1 route_t *route_open() int route_add(route_t *route, route_entry *entry) int route_delete(route_t *route, route_entry *entry) int route_get(route_t *route, route_entry *entry) int route_loop(route_t *route, route_handler callback, void *arg) route_t *route_close(route_t *route) cdef int __route_callback(route_entry *entry, void *arg) except -1: f, a = arg dst, gw = addr(), addr() (dst)._addr = entry.route_dst (gw)._addr = entry.route_gw ret = f((dst, gw), a) if not ret: ret = 0 return ret cdef class route: """route() -> Routing table object Open a handle to the system routing table. """ cdef route_t *route def __init__(self): self.route = route_open() if not self.route: raise OSError, __oserror() def add(self, addr dst, addr gw): """Add an entry to the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object gw -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr entry.route_gw = gw._addr if route_add(self.route, &entry) < 0: raise OSError, __oserror() def delete(self, addr dst): """Delete an entry from the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr if route_delete(self.route, &entry) < 0: raise OSError, __oserror() def get(self, addr dst): """Return the hardware address for a given protocol address in the system routing table. Arguments: dst -- ADDR_TYPE_IP network address object """ cdef route_entry entry entry.route_dst = dst._addr if route_get(self.route, &entry) == 0: return addr(addr_ntoa(&entry.route_gw)) return None def loop(self, callback, arg=None): """Iterate over the system routing table, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with ((dst, gw), arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return route_loop(self.route, __route_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.route: route_close(self.route) # # fw.h # cdef extern from *: cdef struct fw_rule: char fw_device[16] int fw_op int fw_dir int fw_proto addr_t fw_src addr_t fw_dst int fw_sport[2] int fw_dport[2] ctypedef struct fw_t: int __xxx ctypedef int (*fw_handler)(fw_rule *rule, void *arg) except -1 fw_t *fw_open() int fw_add(fw_t *f, fw_rule *rule) int fw_delete(fw_t *f, fw_rule *rule) int fw_loop(fw_t *f, fw_handler callback, void *arg) fw_t *fw_close(fw_t *f) FW_OP_ALLOW = 1 FW_OP_BLOCK = 2 FW_DIR_IN = 1 FW_DIR_OUT = 2 cdef object rule_to_dict(fw_rule *rule): d = {} d['device'] = rule.fw_device d['op'] = rule.fw_op d['dir'] = rule.fw_dir if rule.fw_proto != 0: d['proto'] = rule.fw_proto if rule.fw_src.addr_type != ADDR_TYPE_NONE: d['src'] = addr(addr_ntoa(&rule.fw_src)) if rule.fw_dst.addr_type != ADDR_TYPE_NONE: d['dst'] = addr(addr_ntoa(&rule.fw_dst)) if not (rule.fw_sport[0] == 0 and rule.fw_sport[1] == 0): d['sport'] = [ rule.fw_sport[0], rule.fw_sport[1] ] if not (rule.fw_dport[0] == 0 and rule.fw_dport[1] == 0): d['dport'] = [ rule.fw_dport[0], rule.fw_dport[1] ] return d cdef dict_to_rule(object d, fw_rule *rule): s = d['device'] strlcpy(rule.fw_device, s, 16) rule.fw_op = d['op'] rule.fw_dir = d['dir'] if 'proto' in d: rule.fw_proto = d['proto'] if rule.fw_proto == IP_PROTO_TCP or rule.fw_proto == IP_PROTO_UDP: rule.fw_sport[1] = 65535 rule.fw_dport[1] = 65535 if 'src' in d: rule.fw_src = (d['src'])._addr if 'dst' in d: rule.fw_dst = (d['dst'])._addr if 'sport' in d: rule.fw_sport[0] = d['sport'][0] rule.fw_sport[1] = d['sport'][1] if 'dport' in d: rule.fw_dport[0] = d['dport'][0] rule.fw_dport[1] = d['dport'][1] cdef int __fw_callback(fw_rule *rule, void *arg) except -1: f, a = arg ret = f(rule_to_dict(rule), a) if not ret: ret = 0 return ret cdef class fw: """fw() -> Firewall ruleset object Open a handle to the local network firewall configuration. """ cdef fw_t *fw def __init__(self): self.fw = fw_open() if not self.fw: raise OSError, __oserror() def add(self, d): """Add a firewall rule specified as a dict. Dict values: device -- interface name (string) op -- operation (FW_OP_*) (integer) dir -- direction (FW_DIR_*) (integer) proto -- IP protocol (IP_PROTO_*) (integer) src -- source address / net (addr object) dst -- destination address / net (addr object) sport -- source port range or ICMP type/mask (list of 2 integers) dport -- dest port range or ICMP code/mask (list of 2 integers) """ cdef fw_rule rule memset(&rule, 0, sizeof(rule)) dict_to_rule(d, &rule) if fw_add(self.fw, &rule) < 0: raise OSError, __oserror() def delete(self, d): """Delete a firewall rule specified as a dict.""" cdef fw_rule rule memset(&rule, 0, sizeof(rule)) dict_to_rule(d, &rule) if fw_delete(self.fw, &rule) < 0: raise OSError, __oserror() def loop(self, callback, arg=None): """Iterate over the local firewall ruleset, invoking a user callback with each entry, returning the status of the callback routine. Keyword arguments: callback -- callback function with (dict, arg) prototype. If this function returns a non-zero value, the loop will break early. arg -- optional callback argument """ _arg = (callback, arg) return fw_loop(self.fw, __fw_callback, _arg) def __iter__(self): l = [] self.loop(__iter_append, l) return iter(l) def __dealloc__(self): if self.fw: fw_close(self.fw) # # rand.h # cdef extern from *: ctypedef struct rand_t: int __xxx rand_t *rand_open() int rand_get(rand_t *rand, char *buf, int len) int rand_set(rand_t *rand, char *seed, int len) int rand_add(rand_t *rand, char *buf, int len) unsigned int rand_uint8(rand_t *rand) unsigned int rand_uint16(rand_t *rand) unsigned long rand_uint32(rand_t *rand) rand_t *rand_close(rand_t *rand) cdef class rand: """rand() -> Pseudo-random number generator Obtain a handle for fast, cryptographically strong pseudo-random number generation. The starting seed is derived from the system random data source device (if one exists), or from the current time and random stack contents. """ cdef rand_t *rand def __init__(self): self.rand = rand_open() if not self.rand: raise OSError, __oserror() def get(self, len): """Return a string of random bytes. Arguments: len -- number of random bytes to generate """ cdef char buf[1024] cdef char *p if len <= 1024: rand_get(self.rand, buf, len) return PyString_FromStringAndSize(buf, len) p = malloc(len) rand_get(self.rand, p, len) s = PyString_FromStringAndSize(p, len) free(p) return s def set(self, buf): """Initialize the PRNG from a known seed. Arguments: string -- binary string seed value """ rand_set(self.rand, buf, PyString_Size(buf)) def add(self, buf): """Add additional entropy into the PRNG mix. Arguments: string -- binary string """ rand_add(self.rand, buf, PyString_Size(buf)) def uint8(self): """Return a random 8-bit integer.""" return rand_uint8(self.rand) def uint16(self): """Return a random 16-bit integer.""" return rand_uint16(self.rand) def uint32(self): """Return a random 32-bit integer.""" return rand_uint32(self.rand) def xrange(self, start, stop=None): """xrange([start,] stop) -> xrange object Return a random permutation iterator to walk an unsigned integer range, like xrange(). """ if stop == None: return __rand_xrange(self, 0, start) else: return __rand_xrange(self, start, stop) def __dealloc__(self): if self.rand: rand_close(self.rand) # Modified (variable block length) TEA by Niels Provos cdef enum: TEADELTA = 0x9e3779b9 TEAROUNDS = 32 TEASBOXSIZE = 128 TEASBOXSHIFT = 7 cdef class __rand_xrange: cdef rand_t *rand cdef unsigned long cur, enc, max, mask, start, sboxmask cdef unsigned int sbox[128] # TEASBOXSIZE cdef int left, right, kshift def __init__(self, r, start, stop): cdef unsigned int bits self.rand = (r).rand if PyInt_Check(start): self.start = PyInt_AsLong(start) elif PyLong_Check(start): self.start = PyLong_AsUnsignedLong(start) else: raise TypeError, 'start must be an integer' if PyInt_Check(start): self.max = PyInt_AsLong(stop) - self.start elif PyLong_Check(start): self.max = PyLong_AsUnsignedLong(stop) - self.start else: raise TypeError, 'stop must be an integer' # XXX - permute range once only! rand_get(self.rand, self.sbox, sizeof(self.sbox)) bits = 0 while self.max > (1 << bits): bits = bits + 1 self.left = bits / 2 self.right = bits - self.left self.mask = (1 << bits) - 1 if TEASBOXSIZE < (1 << self.left): self.sboxmask = TEASBOXSIZE - 1 self.kshift = TEASBOXSHIFT else: self.sboxmask = (1 << self.left) - 1 self.kshift = self.left def __iter__(self): self.cur = self.enc = 0 # XXX - rewind iterator, but do not permute range again! return self def __len__(self): return self.max def __next__(self): cdef unsigned long c, sum if self.cur == self.max: raise StopIteration self.cur = self.cur + 1 while 1: c = self.enc self.enc = self.enc + 1 sum = 0 for i from 0 < i < TEAROUNDS: sum = sum + TEADELTA c = c ^ (self.sbox[(c ^ sum) & self.sboxmask] << self.kshift) c = c + sum c = c & self.mask c = ((c << self.left) | (c >> self.right)) & self.mask if c < self.max: break return self.start + c # # tun.h # cdef extern from *: ctypedef struct tun_t: int __xxx tun_t *tun_open(addr_t *src, addr_t *dst, int mtu) int tun_fileno(tun_t *tun) char *tun_name(tun_t *tun) int tun_send(tun_t *tun, char *buf, int size) int tun_recv(tun_t *tun, char *buf, int size) tun_t *tun_close(tun_t *tun) cdef class tun: """tun(src, dst[, mtu]) -> Network tunnel interface handle Obtain a handle to a network tunnel interface, to which packets destined for dst are delivered (with source addresses rewritten to src), where they may be read by a userland process and processed as desired. Packets written back to the handle are injected into the kernel networking subsystem. """ cdef tun_t *tun cdef char *buf cdef int mtu def __init__(self, addr src, addr dst, mtu=1500): self.tun = tun_open(&src._addr, &dst._addr, mtu) self.mtu = mtu if not self.tun: raise OSError, __oserror() self.buf = malloc(mtu) property name: """Tunnel interface name.""" def __get__(self): return tun_name(self.tun) property fd: """File descriptor for tunnel handle.""" def __get__(self): return tun_fileno(self.tun) def fileno(self): """Return file descriptor for tunnel handle.""" return tun_fileno(self.tun) def send(self, pkt): """Send an IP packet, returning the number of bytes sent or -1 on failure. Arguments: pkt -- binary string representing an IP packet """ return tun_send(self.tun, pkt, PyString_Size(pkt)) def recv(self): """Return the next packet delivered to the tunnel interface.""" cdef int n n = tun_recv(self.tun, self.buf, self.mtu) if n < 0: raise OSError, __oserror() return PyString_FromStringAndSize(self.buf, n) def close(self): self.tun = tun_close(self.tun) def __dealloc__(self): if self.buf: free(self.buf) if self.tun: tun_close(self.tun) libdnet-1.12/trunk/python/Makefile.am0000644000076500007650000000115610207725127020754 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 601 2005-02-25 22:44:39Z dugsong $ include $(top_srcdir)/Makefile.am.common if PYTHON # XXX - nasty automake fudging here... noinst_SCRIPTS = python-build $(srcdir)/dnet.c: $(srcdir)/dnet.pyx pyrexc $(srcdir)/dnet.pyx python-build: $(srcdir)/dnet.c $(PYTHON) setup.py build touch python-build python-clean: rm -rf *build clean: python-clean distclean: clean python-install: $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix) install-exec-local: python-install TESTS = test.py else install-exec-local: endif EXTRA_DIST = dnet.pyx dnet.c setup.py.in test.py DISTCLEANFILES = *~ libdnet-1.12/trunk/python/Makefile.in0000644000076500007650000002054610554377612021000 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include # XXX - nasty automake fudging here... @PYTHON_TRUE@noinst_SCRIPTS = python-build @PYTHON_TRUE@TESTS = test.py EXTRA_DIST = dnet.pyx dnet.c setup.py.in test.py DISTCLEANFILES = *~ subdir = python mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = setup.py SCRIPTS = $(noinst_SCRIPTS) depcomp = am__depfiles_maybe = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in setup.py.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign python/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) setup.py: $(top_builddir)/config.status setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-exec-local install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distdir dvi dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-exec-local \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool uninstall uninstall-am uninstall-info-am @PYTHON_TRUE@$(srcdir)/dnet.c: $(srcdir)/dnet.pyx @PYTHON_TRUE@ pyrexc $(srcdir)/dnet.pyx @PYTHON_TRUE@python-build: $(srcdir)/dnet.c @PYTHON_TRUE@ $(PYTHON) setup.py build @PYTHON_TRUE@ touch python-build @PYTHON_TRUE@python-clean: @PYTHON_TRUE@ rm -rf *build @PYTHON_TRUE@clean: python-clean @PYTHON_TRUE@distclean: clean @PYTHON_TRUE@python-install: @PYTHON_TRUE@ $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix) @PYTHON_TRUE@install-exec-local: python-install @PYTHON_FALSE@install-exec-local: # 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: libdnet-1.12/trunk/python/pyrex.diff0000644000076500007650000000503310051046254020711 0ustar dugsongdugsong00000000000000--- PyrexTypes.py.orig Sat Oct 4 00:45:39 2003 +++ PyrexTypes.py Wed May 12 01:54:44 2004 @@ -296,6 +296,12 @@ self.is_returncode = is_returncode +class CULongType(CIntType): + + to_py_function = "PyLong_FromUnsignedLong" + from_py_function = "PyLong_AsUnsignedLong" + + class CLongLongType(CIntType): to_py_function = "PyLong_FromLongLong" @@ -636,7 +642,7 @@ c_uchar_type = CIntType(0, 0, "T_UBYTE") c_ushort_type = CIntType(1, 0, "T_USHORT") c_uint_type = CIntType(2, 0, "T_UINT") -c_ulong_type = CIntType(3, 0, "T_ULONG") +c_ulong_type = CULongType(3, 0, "T_ULONG") c_ulonglong_type = CULongLongType(4, 0) c_float_type = CFloatType(5, "T_FLOAT") --- TypeSlots.py.orig Wed May 12 01:55:19 2004 +++ TypeSlots.py Thu May 13 23:22:51 2004 @@ -359,10 +359,10 @@ intintargproc = Signature("Tii", 'r') objargfunc = Signature("TO", "O") objobjargproc = Signature("TOO", 'r') # typedef int (*objobjargproc)(PyObject *, PyObject *, PyObject *); -getreadbufferproc = Signature("TiP", 'r') # typedef int (*getreadbufferproc)(PyObject *, int, void **); -getwritebufferproc = Signature("TiP", 'r') # typedef int (*getwritebufferproc)(PyObject *, int, void **); -getsegcountproc = Signature("TI", 'r') # typedef int (*getsegcountproc)(PyObject *, int *); -getcharbufferproc = Signature("TiS", 'r') # typedef int (*getcharbufferproc)(PyObject *, int, const char **); +getreadbufferproc = Signature("TiP", 'i') # typedef int (*getreadbufferproc)(PyObject *, int, void **); +getwritebufferproc = Signature("TiP", 'i') # typedef int (*getwritebufferproc)(PyObject *, int, void **); +getsegcountproc = Signature("TI", 'i') # typedef int (*getsegcountproc)(PyObject *, int *); +getcharbufferproc = Signature("TiS", 'i') # typedef int (*getcharbufferproc)(PyObject *, int, const char **); objargproc = Signature("TO", 'r') # typedef int (*objobjproc)(PyObject *, PyObject *); # typedef int (*visitproc)(PyObject *, void *); # typedef int (*traverseproc)(PyObject *, visitproc, void *); @@ -461,7 +461,7 @@ MethodSlot(intintargfunc, "sq_slice", "__getslice__"), EmptySlot("sq_ass_item"), # mp_ass_subscript used instead SyntheticSlot("sq_ass_slice", ["__setslice__", "__delslice__"], "0"), - MethodSlot(objargproc, "sq_contains", "__contains__"), + MethodSlot(cmpfunc, "sq_contains", "__contains__"), EmptySlot("sq_inplace_concat"), # nb_inplace_add used instead EmptySlot("sq_inplace_repeat"), # nb_inplace_multiply used instead ) libdnet-1.12/trunk/python/setup.py.in0000644000076500007650000000306510363615225021040 0ustar dugsongdugsong00000000000000#!/usr/bin/env python import glob, os, sys from distutils.core import setup, Extension dnet_srcs = [ '@srcdir@/dnet.c' ] dnet_incdirs = [ '@top_srcdir@/include' ] dnet_libdirs = [] dnet_libs = [] dnet_extargs = [] dnet_extobj = [] if sys.platform == 'win32': winpcap_dir = '../../WPdpack' dnet_srcs.extend(['../src/addr-util.c', '../src/addr.c', '../src/blob.c', '../src/ip-util.c', '../src/ip6.c', '../src/rand.c', '../src/err.c', '../src/strlcat.c', '../src/strlcpy.c', '../src/err.c', '../src/strlcat.c', '../src/strlcpy.c', '../src/strsep.c', '../src/arp-win32.c', '../src/eth-win32.c', '../src/fw-pktfilter.c', '../src/intf-win32.c', '../src/ip-win32.c', '../src/route-win32.c', '../src/tun-none.c']) dnet_incdirs.append(winpcap_dir + '/Include') dnet_libdirs.append(winpcap_dir + '/Lib') dnet_libs.extend([ 'advapi32', 'iphlpapi', 'ws2_32', 'packet' ]) else: # XXX - can't build on Cygwin+MinGW yet. #if sys.platform == 'cygwin': # dnet_extargs.append('-mno-cygwin') dnet_extobj.extend(glob.glob('@top_builddir@/src/.libs/*.o')) dnet = Extension('dnet', dnet_srcs, include_dirs=dnet_incdirs, library_dirs=dnet_libdirs, libraries=dnet_libs, extra_compile_args=dnet_extargs, extra_objects=dnet_extobj) setup(name='dnet', version='@VERSION@', description='low-level networking library', author='Dug Song', author_email='dugsong@monkey.org', url='http://libdnet.sourceforge.net/', ext_modules = [ dnet ]) libdnet-1.12/trunk/python/test.py0000755000076500007650000002051510046250010020235 0ustar dugsongdugsong00000000000000#!/usr/bin/env python import sys, unittest sys.path.insert(0, './build') import dnet class AddrTestCase(unittest.TestCase): def test_addr_cmp(self): for atxt in ('1.2.3.0', '0:d:e:a:d:0', 'fe::ed:fa:ce:0'): a = dnet.addr(atxt) b = dnet.addr(atxt) assert a == b b = dnet.addr(atxt[:-1] + '1') assert a < b assert b > a def test_addr_bcast(self): d = { 32:'10.0.0.0', 31:'10.0.0.1', 30:'10.0.0.3', 29:'10.0.0.7', 28:'10.0.0.15', 27:'10.0.0.31', 26:'10.0.0.63', 25:'10.0.0.127', 24:'10.0.0.255', 23:'10.0.1.255', 22:'10.0.3.255', 21:'10.0.7.255', 20:'10.0.15.255', 19:'10.0.31.255' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.bcast() self.failUnless(b.__str__() == d[bits], 'wrong bcast for /%d' % bits) def test_addr_net(self): d = { 32:'1.255.255.255', 31:'1.255.255.254', 30:'1.255.255.252', 29:'1.255.255.248', 28:'1.255.255.240', 27:'1.255.255.224', 26:'1.255.255.192', 25:'1.255.255.128', 24:'1.255.255.0', 23:'1.255.254.0', 22:'1.255.252.0', 21:'1.255.248.0', 20:'1.255.240.0', 19:'1.255.224.0' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.net() self.failUnless(b.__str__() == d[bits], 'wrong net for /%d' % bits) def test_addr_properties(self): atxt = '1.2.3.4/24' a = dnet.addr(atxt) assert a.type == dnet.ADDR_TYPE_IP and a.bits == 24 assert a.ip == '\x01\x02\x03\x04' and a.__str__() == atxt try: self.failUnless(a.eth == 'xxx', 'invalid eth property') except ValueError: pass atxt = '00:0d:0e:0a:0d:00' a = dnet.addr(atxt) assert a == dnet.addr('0:d:E:a:D:0') assert a.type == dnet.ADDR_TYPE_ETH and a.bits == 48 assert a.eth == '\x00\x0d\x0e\x0a\x0d\x00' and a.__str__() == atxt try: self.failUnless(a.ip6 == 'xxx', 'invalid ip6 property') except ValueError: pass atxt = 'fe80::dead:beef:feed:face/48' a = dnet.addr(atxt) assert a == dnet.addr('fe80:0:0::dead:beef:feed:face/48') assert a.type == dnet.ADDR_TYPE_IP6 and a.bits == 48 assert a.ip6 == '\xfe\x80\x00\x00\x00\x00\x00\x00\xde\xad\xbe\xef\xfe\xed\xfa\xce' and a.__str__() == atxt try: self.failUnless(a.ip == 'xxx', 'invalid ip property') except ValueError: pass class ArpTestCase(unittest.TestCase): def setUp(self): self.arp = dnet.arp() self.failUnless(self.arp, "couldn't open ARP handle") def tearDown(self): del self.arp def test_arp(self): # XXX - site-specific values here! pa = dnet.addr('192.168.0.123') ha = dnet.addr('0:d:e:a:d:0') self.failUnless(self.arp.add(pa, ha) == None, "couldn't add ARP entry") self.failUnless(self.arp.get(pa) == ha, "couldn't find ARP entry") self.failUnless(self.arp.delete(pa) == None, "couldn't delete ARP entry") def __arp_cb(self, pa, ha, arg): # XXX - do nothing return arg def test_arp_loop(self): assert self.arp.loop(self.__arp_cb, 0) == 0 assert self.arp.loop(self.__arp_cb, 123) == 123 def test_arp_misc(self): sha = '\x00\x0d\x0e\x0a\x0d\x00' spa = '\x01\x02\x03\x04' dha = '\x00\x0b\x0e\x0e\x0f\x00' dpa = '\x05\x06\x07\x08' msg = dnet.arp_pack_hdr_ethip(dnet.ARP_OP_REQUEST, sha, spa, dha, dpa) assert msg == '\x00\x01\x08\x00\x06\x04\x00\x01\x00\r\x0e\n\r\x00\x01\x02\x03\x04\x00\x0b\x0e\x0e\x0f\x00\x05\x06\x07\x08' class EthTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.eth = dnet.eth(self.dev) self.failUnless(self.eth, "couldn't open Ethernet handle") def tearDown(self): del self.eth def test_eth_get(self): mac = self.eth.get() self.failUnless(mac, "couldn't get Ethernet address for %s" % self.dev) def test_eth_misc(self): n = "\x00\x0d\x0e\x0a\x0d\x00" a = '00:0d:0e:0a:0d:00' self.failUnless(dnet.eth_ntoa(n) == a) self.failUnless(dnet.eth_aton(a) == n) dst = "\x00\x0d\x0e\x0a\x0d\x01" self.failUnless(dnet.eth_pack_hdr(n, dst, dnet.ETH_TYPE_IP) == '\x00\r\x0e\n\r\x00\x00\r\x0e\n\r\x01\x08\x00') class FwTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.fw = dnet.fw() self.failUnless(self.fw, "couldn't open firewall handle") def tearDown(self): del self.fw def test_fw(self): src = dnet.addr('1.2.3.4') dst = dnet.addr('5.6.7.8') d = { 'device':self.dev, 'op':dnet.FW_OP_BLOCK, 'dir':dnet.FW_DIR_OUT, 'proto':dnet.IP_PROTO_UDP, 'src':src, 'dst':dst, 'dport':(660, 666) } self.failUnless(self.fw.add(d) == None, "couldn't add firewall rule: %s" % d) self.failUnless(self.fw.delete(d) == None, "couldn't delete firewall rule: %s" % d) def __fw_cb(self, rule, arg): # XXX - do nothing return arg def test_fw_loop(self): assert self.fw.loop(self.__fw_cb, 0) == 0 # XXX - no guarantee of existing fw rules. #assert self.fw.loop(self.__fw_cb, 123) == 123 class IntfTestCase(unittest.TestCase): def setUp(self): self.intf = dnet.intf() self.failUnless(self.intf, "couldn't open interface handle") def tearDown(self): del self.intf def test_intf_get(self): lo0 = self.intf.get('lo0') self.failUnless(lo0['name'] == 'lo0', "couldn't get loopback config") self.failUnless(self.intf.get_src(dnet.addr('127.0.0.1')) == lo0, "couldn't get_src 127.0.0.1") gw = self.intf.get_dst(dnet.addr('1.2.3.4')) self.failUnless(gw, "couldn't get outgoing interface") def test_intf_set(self): lo0 = self.intf.get('lo0') old_mtu = lo0['mtu'] new_mtu = 1234 lo0['mtu'] = new_mtu self.intf.set(lo0) lo0 = self.intf.get('lo0') assert lo0['mtu'] == new_mtu lo0['mtu'] = old_mtu self.intf.set(lo0) def __intf_cb(self, ifent, arg): # XXX - do nothing return arg def test_intf_loop(self): assert self.intf.loop(self.__intf_cb, 0) == 0 assert self.intf.loop(self.__intf_cb, 123) == 123 class IpTestCase(unittest.TestCase): def setUp(self): self.ip = dnet.ip() self.failUnless(self.ip, "couldn't open raw IP handle") def tearDown(self): del self.ip def test_ip_misc(self): n = '\x01\x02\x03\x04' a = '1.2.3.4' self.failUnless(dnet.ip_ntoa(n) == a) self.failUnless(dnet.ip_aton(a) == n) dst = '\x05\x06\x07\x08' hdr = dnet.ip_pack_hdr(0, dnet.IP_HDR_LEN, 666, 0, 255, dnet.IP_PROTO_UDP, n, dst) assert hdr == 'E\x00\x00\x14\x02\x9a\x00\x00\xff\x11\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' hdr = dnet.ip_checksum(hdr) assert hdr == 'E\x00\x00\x14\x02\x9a\x00\x00\xff\x11\xa9+\x01\x02\x03\x04\x05\x06\x07\x08' class RandTestCase(unittest.TestCase): def setUp(self): self.rand = dnet.rand() self.failUnless(self.rand, "couldn't open random handle") def tearDown(self): del self.rand class RouteTestCase(unittest.TestCase): def setUp(self): self.route = dnet.route() self.failUnless(self.route, "couldn't open route handle") def tearDown(self): del self.route def test_route(self): dst = dnet.addr('1.2.3.4/24') gw = dnet.addr('127.0.0.1') self.route.add(dst, gw) self.failUnless(self.route.get(dst) == gw) self.route.delete(dst) def __route_cb(self, dst, gw, arg): # XXX - do nothing return arg def test_route_loop(self): assert self.route.loop(self.__route_cb, 0) == 0 assert self.route.loop(self.__route_cb, 123) == 123 if __name__ == '__main__': unittest.main() libdnet-1.12/trunk/README0000644000076500007650000000065610204210541016245 0ustar dugsongdugsong00000000000000 libdnet ------- libdnet provides a simplified, portable interface to several low-level networking routines, including network address manipulation, kernel arp(4) cache and route(4) table lookup and manipulation, network firewalling, network interface lookup and manipulation, IP tunnelling, and raw IP packet and Ethernet frame transmission. WWW: http://libdnet.sourceforge.net/ $Id: README 578 2005-02-14 21:00:17Z dugsong $ libdnet-1.12/trunk/src/0000755000076500007650000000000010554406440016162 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/src/addr-util.c0000644000076500007650000001663010174652026020222 0ustar dugsongdugsong00000000000000/* * addr-util.c * * Copyright (c) 2002 Dug Song * * $Id: addr-util.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" static const char *octet2dec[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255" }; static const char *octet2hex[] = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff" }; char * eth_ntop(const eth_addr_t *eth, char *dst, size_t len) { const char *x; char *p = dst; int i; if (len < 18) return (NULL); for (i = 0; i < ETH_ADDR_LEN; i++) { for (x = octet2hex[eth->data[i]]; (*p = *x) != '\0'; x++, p++) ; *p++ = ':'; } p[-1] = '\0'; return (dst); } char * eth_ntoa(const eth_addr_t *eth) { struct addr a; addr_pack(&a, ADDR_TYPE_ETH, ETH_ADDR_BITS, eth->data, ETH_ADDR_LEN); return (addr_ntoa(&a)); } int eth_pton(const char *p, eth_addr_t *eth) { char *ep; long l; int i; for (i = 0; i < ETH_ADDR_LEN; i++) { l = strtol(p, &ep, 16); if (ep == p || l < 0 || l > 0xff || (i < ETH_ADDR_LEN - 1 && *ep != ':')) break; eth->data[i] = (u_char)l; p = ep + 1; } return ((i == ETH_ADDR_LEN && *ep == '\0') ? 0 : -1); } char * ip_ntop(const ip_addr_t *ip, char *dst, size_t len) { const char *d; char *p = dst; u_char *data = (u_char *)ip; int i; if (len < 16) return (NULL); for (i = 0; i < IP_ADDR_LEN; i++) { for (d = octet2dec[data[i]]; (*p = *d) != '\0'; d++, p++) ; *p++ = '.'; } p[-1] = '\0'; return (dst); } char * ip_ntoa(const ip_addr_t *ip) { struct addr a; addr_pack(&a, ADDR_TYPE_IP, IP_ADDR_BITS, ip, IP_ADDR_LEN); return (addr_ntoa(&a)); } int ip_pton(const char *p, ip_addr_t *ip) { u_char *data = (u_char *)ip; char *ep; long l; int i; for (i = 0; i < IP_ADDR_LEN; i++) { l = strtol(p, &ep, 10); if (ep == p || l < 0 || l > 0xff || (i < IP_ADDR_LEN - 1 && *ep != '.')) break; data[i] = (u_char)l; p = ep + 1; } return ((i == IP_ADDR_LEN && *ep == '\0') ? 0 : -1); } char * ip6_ntop(const ip6_addr_t *ip6, char *dst, size_t len) { struct { int base, len; } best, cur; char *p = dst; int i; if (len < 46) return (NULL); best.base = cur.base = -1; /* * Algorithm borrowed from Vixie's inet_pton6() */ for (i = 0; i < IP6_ADDR_LEN; i += 2) { if (*((uint16_t *)&ip6->data[i]) == 0) { if (cur.base == -1) { cur.base = i; cur.len = 0; } else cur.len += 2; } else { if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } } if (cur.base != -1 && (best.base == -1 || cur.len > best.len)) best = cur; if (best.base != -1 && best.len < 2) best.base = -1; if (best.base == 0) *p++ = ':'; for (i = 0; i < IP6_ADDR_LEN; i += 2) { if (i == best.base) { *p++ = ':'; i += best.len; } else if (i == 12 && best.base == 0 && (best.len == 10 || (best.len == 8 && *((uint16_t *)&ip6->data[10]) == 0xffff))) { if (ip_ntop((ip_addr_t *)&ip6->data[12], p, len - (p - dst)) == NULL) return (NULL); return (dst); } else p += sprintf(p, "%x:", ntohs(*((uint16_t *)&ip6->data[i]))); } if (best.base + 2 + best.len == IP6_ADDR_LEN) { *p = '\0'; } else p[-1] = '\0'; return (dst); } char * ip6_ntoa(const ip6_addr_t *ip6) { struct addr a; addr_pack(&a, ADDR_TYPE_IP6, IP6_ADDR_BITS, ip6->data, IP6_ADDR_LEN); return (addr_ntoa(&a)); } int ip6_pton(const char *p, ip6_addr_t *ip6) { uint16_t data[8], *u = (uint16_t *)ip6->data; int i, j, n, z = -1; char *ep; long l; if (*p == ':') p++; for (n = 0; n < 8; n++) { l = strtol(p, &ep, 16); if (ep == p) { if (ep[0] == ':' && z == -1) { z = n; p++; } else if (ep[0] == '\0') { break; } else { return (-1); } } else if (ep[0] == '.' && n <= 6) { if (ip_pton(p, (ip_addr_t *)(data + n)) < 0) return (-1); n += 2; ep = ""; /* XXX */ break; } else if (l >= 0 && l <= 0xffff) { data[n] = htons((uint16_t)l); if (ep[0] == '\0') { n++; break; } else if (ep[0] != ':' || ep[1] == '\0') return (-1); p = ep + 1; } else return (-1); } if (n == 0 || *ep != '\0' || (z == -1 && n != 8)) return (-1); for (i = 0; i < z; i++) { u[i] = data[i]; } while (i < 8 - (n - z - 1)) { u[i++] = 0; } for (j = z + 1; i < 8; i++, j++) { u[i] = data[j]; } return (0); } libdnet-1.12/trunk/src/addr.c0000644000076500007650000002317110257571236017252 0ustar dugsongdugsong00000000000000/* * addr.c * * Network address operations. * * Copyright (c) 2000 Dug Song * * $Id: addr.c 610 2005-06-26 18:23:26Z dugsong $ */ #include "config.h" #include #ifdef HAVE_NET_IF_H # include # include #endif #ifdef HAVE_NET_IF_DL_H # include #endif #ifdef HAVE_NET_RAW_H # include #endif #include #include #include #include #include #include "dnet.h" #ifndef MAXHOSTNAMELEN # define MAXHOSTNAMELEN 256 #endif union sockunion { #ifdef HAVE_NET_IF_DL_H struct sockaddr_dl sdl; #endif struct sockaddr_in sin; #ifdef HAVE_SOCKADDR_IN6 struct sockaddr_in6 sin6; #endif struct sockaddr sa; #ifdef AF_RAW struct sockaddr_raw sr; #endif }; int addr_cmp(const struct addr *a, const struct addr *b) { int i, j, k; /* XXX */ if ((i = a->addr_type - b->addr_type) != 0) return (i); /* XXX - 10.0.0.1 is "smaller" than 10.0.0.0/8? */ if ((i = a->addr_bits - b->addr_bits) != 0) return (i); j = b->addr_bits / 8; for (i = 0; i < j; i++) { if ((k = a->addr_data8[i] - b->addr_data8[i]) != 0) return (k); } if ((k = b->addr_bits % 8) == 0) return (0); k = ~0 << (8 - k); i = b->addr_data8[j] & k; j = a->addr_data8[j] & k; return (j - i); } int addr_net(const struct addr *a, struct addr *b) { uint32_t mask; int i, j; if (a->addr_type == ADDR_TYPE_IP) { addr_btom(a->addr_bits, &mask, IP_ADDR_LEN); b->addr_type = ADDR_TYPE_IP; b->addr_bits = IP_ADDR_BITS; b->addr_ip = a->addr_ip & mask; } else if (a->addr_type == ADDR_TYPE_ETH) { memcpy(b, a, sizeof(*b)); if (a->addr_data8[0] & 0x1) memset(b->addr_data8 + 3, 0, 3); b->addr_bits = ETH_ADDR_BITS; } else if (a->addr_type == ADDR_TYPE_IP6) { b->addr_type = ADDR_TYPE_IP6; b->addr_bits = IP6_ADDR_BITS; memset(&b->addr_ip6, 0, IP6_ADDR_LEN); switch ((i = a->addr_bits / 32)) { case 4: b->addr_data32[3] = a->addr_data32[3]; case 3: b->addr_data32[2] = a->addr_data32[2]; case 2: b->addr_data32[1] = a->addr_data32[1]; case 1: b->addr_data32[0] = a->addr_data32[0]; } if ((j = a->addr_bits % 32) > 0) { addr_btom(j, &mask, sizeof(mask)); b->addr_data32[i] = a->addr_data32[i] & mask; } } else return (-1); return (0); } int addr_bcast(const struct addr *a, struct addr *b) { struct addr mask; if (a->addr_type == ADDR_TYPE_IP) { addr_btom(a->addr_bits, &mask.addr_ip, IP_ADDR_LEN); b->addr_type = ADDR_TYPE_IP; b->addr_bits = IP_ADDR_BITS; b->addr_ip = (a->addr_ip & mask.addr_ip) | (~0L & ~mask.addr_ip); } else if (a->addr_type == ADDR_TYPE_ETH) { b->addr_type = ADDR_TYPE_ETH; b->addr_bits = ETH_ADDR_BITS; memcpy(&b->addr_eth, ETH_ADDR_BROADCAST, ETH_ADDR_LEN); } else { /* XXX - no broadcast addresses in IPv6 */ errno = EINVAL; return (-1); } return (0); } char * addr_ntop(const struct addr *src, char *dst, size_t size) { if (src->addr_type == ADDR_TYPE_IP && size >= 20) { if (ip_ntop(&src->addr_ip, dst, size) != NULL) { if (src->addr_bits != IP_ADDR_BITS) sprintf(dst + strlen(dst), "/%d", src->addr_bits); return (dst); } } else if (src->addr_type == ADDR_TYPE_IP6 && size >= 42) { if (ip6_ntop(&src->addr_ip6, dst, size) != NULL) { if (src->addr_bits != IP6_ADDR_BITS) sprintf(dst + strlen(dst), "/%d", src->addr_bits); return (dst); } } else if (src->addr_type == ADDR_TYPE_ETH && size >= 18) { if (src->addr_bits == ETH_ADDR_BITS) return (eth_ntop(&src->addr_eth, dst, size)); } errno = EINVAL; return (NULL); } int addr_pton(const char *src, struct addr *dst) { struct hostent *hp; char *ep, tmp[300]; long bits = -1; int i; for (i = 0; i < (int)sizeof(tmp) - 1; i++) { if (src[i] == '/') { tmp[i] = '\0'; if (strchr(&src[i + 1], '.')) { uint32_t m; uint16_t b; /* XXX - mask is specified like /255.0.0.0 */ if (ip_pton(&src[i + 1], &m) != 0) { errno = EINVAL; return (-1); } addr_mtob(&m, sizeof(m), &b); bits = b; } else { bits = strtol(&src[i + 1], &ep, 10); if (ep == src || *ep != '\0' || bits < 0) { errno = EINVAL; return (-1); } } break; } else if ((tmp[i] = src[i]) == '\0') break; } if (ip_pton(tmp, &dst->addr_ip) == 0) { dst->addr_type = ADDR_TYPE_IP; dst->addr_bits = IP_ADDR_BITS; } else if (eth_pton(tmp, &dst->addr_eth) == 0) { dst->addr_type = ADDR_TYPE_ETH; dst->addr_bits = ETH_ADDR_BITS; } else if (ip6_pton(tmp, &dst->addr_ip6) == 0) { dst->addr_type = ADDR_TYPE_IP6; dst->addr_bits = IP6_ADDR_BITS; } else if ((hp = gethostbyname(tmp)) != NULL) { memcpy(&dst->addr_ip, hp->h_addr, IP_ADDR_LEN); dst->addr_type = ADDR_TYPE_IP; dst->addr_bits = IP_ADDR_BITS; } else { errno = EINVAL; return (-1); } if (bits >= 0) { if (bits > dst->addr_bits) { errno = EINVAL; return (-1); } dst->addr_bits = (uint16_t)bits; } return (0); } char * addr_ntoa(const struct addr *a) { static char *p, buf[BUFSIZ]; char *q = NULL; if (p == NULL || p > buf + sizeof(buf) - 64 /* XXX */) p = buf; if (addr_ntop(a, p, (buf + sizeof(buf)) - p) != NULL) { q = p; p += strlen(p) + 1; } return (q); } int addr_ntos(const struct addr *a, struct sockaddr *sa) { union sockunion *so = (union sockunion *)sa; switch (a->addr_type) { case ADDR_TYPE_ETH: #ifdef HAVE_NET_IF_DL_H memset(&so->sdl, 0, sizeof(so->sdl)); # ifdef HAVE_SOCKADDR_SA_LEN so->sdl.sdl_len = sizeof(so->sdl); # endif so->sdl.sdl_family = AF_LINK; so->sdl.sdl_alen = ETH_ADDR_LEN; memcpy(LLADDR(&so->sdl), &a->addr_eth, ETH_ADDR_LEN); #else memset(sa, 0, sizeof(*sa)); # ifdef AF_LINK sa->sa_family = AF_LINK; # else sa->sa_family = AF_UNSPEC; # endif memcpy(sa->sa_data, &a->addr_eth, ETH_ADDR_LEN); #endif break; #ifdef HAVE_SOCKADDR_IN6 case ADDR_TYPE_IP6: memset(&so->sin6, 0, sizeof(so->sin6)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin6.sin6_len = sizeof(so->sin6); #endif so->sin6.sin6_family = AF_INET6; memcpy(&so->sin6.sin6_addr, &a->addr_ip6, IP6_ADDR_LEN); break; #endif case ADDR_TYPE_IP: memset(&so->sin, 0, sizeof(so->sin)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin.sin_len = sizeof(so->sin); #endif so->sin.sin_family = AF_INET; so->sin.sin_addr.s_addr = a->addr_ip; break; default: errno = EINVAL; return (-1); } return (0); } int addr_ston(const struct sockaddr *sa, struct addr *a) { union sockunion *so = (union sockunion *)sa; memset(a, 0, sizeof(*a)); switch (sa->sa_family) { #ifdef HAVE_NET_IF_DL_H case AF_LINK: if (so->sdl.sdl_alen != ETH_ADDR_LEN) { errno = EINVAL; return (-1); } a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, LLADDR(&so->sdl), ETH_ADDR_LEN); break; #endif case AF_UNSPEC: case ARP_HRD_ETH: /* XXX- Linux arp(7) */ a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, sa->sa_data, ETH_ADDR_LEN); break; #ifdef AF_RAW case AF_RAW: /* XXX - IRIX raw(7f) */ a->addr_type = ADDR_TYPE_ETH; a->addr_bits = ETH_ADDR_BITS; memcpy(&a->addr_eth, so->sr.sr_addr, ETH_ADDR_LEN); break; #endif #ifdef HAVE_SOCKADDR_IN6 case AF_INET6: a->addr_type = ADDR_TYPE_IP6; a->addr_bits = IP6_ADDR_BITS; memcpy(&a->addr_ip6, &so->sin6.sin6_addr, IP6_ADDR_LEN); break; #endif case AF_INET: a->addr_type = ADDR_TYPE_IP; a->addr_bits = IP_ADDR_BITS; a->addr_ip = so->sin.sin_addr.s_addr; break; default: errno = EINVAL; return (-1); } return (0); } int addr_btos(uint16_t bits, struct sockaddr *sa) { union sockunion *so = (union sockunion *)sa; #ifdef HAVE_SOCKADDR_IN6 if (bits > IP_ADDR_BITS && bits <= IP6_ADDR_BITS) { memset(&so->sin6, 0, sizeof(so->sin6)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin6.sin6_len = IP6_ADDR_LEN + (bits / 8) + (bits % 8); #endif so->sin6.sin6_family = AF_INET6; return (addr_btom(bits, &so->sin6.sin6_addr, IP6_ADDR_LEN)); } else #endif if (bits <= IP_ADDR_BITS) { memset(&so->sin, 0, sizeof(so->sin)); #ifdef HAVE_SOCKADDR_SA_LEN so->sin.sin_len = IP_ADDR_LEN + (bits / 8) + (bits % 8); #endif so->sin.sin_family = AF_INET; return (addr_btom(bits, &so->sin.sin_addr, IP_ADDR_LEN)); } errno = EINVAL; return (-1); } int addr_stob(const struct sockaddr *sa, uint16_t *bits) { union sockunion *so = (union sockunion *)sa; int i, j, len; uint16_t n; u_char *p; #ifdef HAVE_SOCKADDR_IN6 if (sa->sa_family == AF_INET6) { len = IP6_ADDR_LEN; p = (u_char *)&so->sin6.sin6_addr; } else #endif { #ifdef HAVE_SOCKADDR_SA_LEN if ((len = sa->sa_len - IP_ADDR_LEN) > IP_ADDR_LEN) #endif len = IP_ADDR_LEN; p = (u_char *)&so->sin.sin_addr.s_addr; } for (n = i = 0; i < len; i++, n += 8) { if (p[i] != 0xff) break; } if (i != len && p[i]) { for (j = 7; j > 0; j--, n++) { if ((p[i] & (1 << j)) == 0) break; } } *bits = n; return (0); } int addr_btom(uint16_t bits, void *mask, size_t size) { int net, host; u_char *p; if (size == IP_ADDR_LEN) { if (bits > IP_ADDR_BITS) { errno = EINVAL; return (-1); } *(uint32_t *)mask = bits ? htonl(~0 << (IP_ADDR_BITS - bits)) : 0; } else { if (size * 8 < bits) { errno = EINVAL; return (-1); } p = (u_char *)mask; if ((net = bits / 8) > 0) memset(p, 0xff, net); if ((host = bits % 8) > 0) { p[net] = 0xff << (8 - host); memset(&p[net + 1], 0, size - net - 1); } else memset(&p[net], 0, size - net); } return (0); } int addr_mtob(const void *mask, size_t size, uint16_t *bits) { uint16_t n; u_char *p; int i, j; p = (u_char *)mask; for (n = i = 0; i < (int)size; i++, n += 8) { if (p[i] != 0xff) break; } if (i != (int)size && p[i]) { for (j = 7; j > 0; j--, n++) { if ((p[i] & (1 << j)) == 0) break; } } *bits = n; return (0); } libdnet-1.12/trunk/src/arp-bsd.c0000644000076500007650000001523610174652026017666 0ustar dugsongdugsong00000000000000/* * arp-bsd.c * * Copyright (c) 2000 Dug Song * * $Id: arp-bsd.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_STREAMS_ROUTE #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct arp_handle { int fd; int seq; }; struct arpmsg { struct rt_msghdr rtm; u_char addrs[256]; }; arp_t * arp_open(void) { arp_t *arp; if ((arp = calloc(1, sizeof(*arp))) != NULL) { #ifdef HAVE_STREAMS_ROUTE if ((arp->fd = open("/dev/route", O_RDWR, 0)) < 0) #else if ((arp->fd = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) #endif return (arp_close(arp)); } return (arp); } static int arp_msg(arp_t *arp, struct arpmsg *msg) { struct arpmsg smsg; int len, i = 0; pid_t pid; msg->rtm.rtm_version = RTM_VERSION; msg->rtm.rtm_seq = ++arp->seq; memcpy(&smsg, msg, sizeof(smsg)); #ifdef HAVE_STREAMS_ROUTE return (ioctl(arp->fd, RTSTR_SEND, &msg->rtm)); #else if (write(arp->fd, &smsg, smsg.rtm.rtm_msglen) < 0) { if (errno != ESRCH || msg->rtm.rtm_type != RTM_DELETE) return (-1); } pid = getpid(); /* XXX - should we only read RTM_GET responses here? */ while ((len = read(arp->fd, msg, sizeof(*msg))) > 0) { if (len < (int)sizeof(msg->rtm)) return (-1); if (msg->rtm.rtm_pid == pid) { if (msg->rtm.rtm_seq == arp->seq) break; continue; } else if ((i++ % 2) == 0) continue; /* Repeat request. */ if (write(arp->fd, &smsg, smsg.rtm.rtm_msglen) < 0) { if (errno != ESRCH || msg->rtm.rtm_type != RTM_DELETE) return (-1); } } if (len < 0) return (-1); return (0); #endif } int arp_add(arp_t *arp, const struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; int index, type; if (entry->arp_pa.addr_type != ADDR_TYPE_IP || entry->arp_ha.addr_type != ADDR_TYPE_ETH) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa)) { errno = EADDRNOTAVAIL; return (-1); } if (sin->sin_addr.s_addr == entry->arp_pa.addr_ip) { if ((msg.rtm.rtm_flags & RTF_LLINFO) == 0 || (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) { errno = EADDRINUSE; return (-1); } } if (sa->sa_family != AF_LINK) { errno = EADDRNOTAVAIL; return (-1); } else { index = ((struct sockaddr_dl *)sa)->sdl_index; type = ((struct sockaddr_dl *)sa)->sdl_type; } if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0 || addr_ntos(&entry->arp_ha, sa) < 0) return (-1); ((struct sockaddr_dl *)sa)->sdl_index = index; ((struct sockaddr_dl *)sa)->sdl_type = type; memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_ADD; msg.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; msg.rtm.rtm_inits = RTV_EXPIRE; msg.rtm.rtm_flags = RTF_HOST | RTF_STATIC; #ifdef HAVE_SOCKADDR_SA_LEN msg.rtm.rtm_msglen = sizeof(msg.rtm) + sin->sin_len + sa->sa_len; #else msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa); #endif return (arp_msg(arp, &msg)); } int arp_delete(arp_t *arp, const struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; if (entry->arp_pa.addr_type != ADDR_TYPE_IP) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa)) { errno = ESRCH; return (-1); } if (sin->sin_addr.s_addr == entry->arp_pa.addr_ip) { if ((msg.rtm.rtm_flags & RTF_LLINFO) == 0 || (msg.rtm.rtm_flags & RTF_GATEWAY) != 0) { errno = EADDRINUSE; return (-1); } } if (sa->sa_family != AF_LINK) { errno = ESRCH; return (-1); } msg.rtm.rtm_type = RTM_DELETE; return (arp_msg(arp, &msg)); } int arp_get(arp_t *arp, struct arp_entry *entry) { struct arpmsg msg; struct sockaddr_in *sin; struct sockaddr *sa; if (entry->arp_pa.addr_type != ADDR_TYPE_IP) { errno = EAFNOSUPPORT; return (-1); } sin = (struct sockaddr_in *)msg.addrs; sa = (struct sockaddr *)(sin + 1); if (addr_ntos(&entry->arp_pa, (struct sockaddr *)sin) < 0) return (-1); memset(&msg.rtm, 0, sizeof(msg.rtm)); msg.rtm.rtm_type = RTM_GET; msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_flags = RTF_LLINFO; msg.rtm.rtm_msglen = sizeof(msg.rtm) + sizeof(*sin); if (arp_msg(arp, &msg) < 0) return (-1); if (msg.rtm.rtm_msglen < (int)sizeof(msg.rtm) + sizeof(*sin) + sizeof(*sa) || sin->sin_addr.s_addr != entry->arp_pa.addr_ip || sa->sa_family != AF_LINK) { errno = ESRCH; return (-1); } if (addr_ston(sa, &entry->arp_ha) < 0) return (-1); return (0); } #ifdef HAVE_SYS_SYSCTL_H int arp_loop(arp_t *arp, arp_handler callback, void *arg) { struct arp_entry entry; struct rt_msghdr *rtm; struct sockaddr_in *sin; struct sockaddr *sa; char *buf, *lim, *next; size_t len; int ret, mib[6] = { CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO }; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if (len == 0) return (0); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } lim = buf + len; ret = 0; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in *)(rtm + 1); sa = (struct sockaddr *)(sin + 1); if (addr_ston((struct sockaddr *)sin, &entry.arp_pa) < 0 || addr_ston(sa, &entry.arp_ha) < 0) continue; if ((ret = callback(&entry, arg)) != 0) break; } free(buf); return (ret); } #else int arp_loop(arp_t *arp, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif arp_t * arp_close(arp_t *arp) { if (arp != NULL) { if (arp->fd >= 0) close(arp->fd); free(arp); } return (NULL); } libdnet-1.12/trunk/src/arp-ioctl.c0000644000076500007650000002435410202507444020224 0ustar dugsongdugsong00000000000000/* * arp-ioctl.c * * Copyright (c) 2001 Dug Song * * $Id: arp-ioctl.c 554 2005-02-09 22:31:00Z dugsong $ */ #include "config.h" #include #include #include #include #ifdef HAVE_STREAMS_MIB2 # include # include # include # include # include # include # include # undef IP_ADDR_LEN #elif defined(HAVE_SYS_MIB_H) # include #endif #include #include #ifdef HAVE_STREAMS_MIB2 # include # include #endif #include #include #include #include #include #include #include "dnet.h" #ifdef HAVE_LINUX_PROCFS #define PROC_ARP_FILE "/proc/net/arp" #endif struct arp_handle { int fd; #ifdef HAVE_ARPREQ_ARP_DEV intf_t *intf; #endif }; arp_t * arp_open(void) { arp_t *a; if ((a = calloc(1, sizeof(*a))) != NULL) { #ifdef HAVE_STREAMS_MIB2 if ((a->fd = open(IP_DEV_NAME, O_RDWR)) < 0) #elif defined(HAVE_STREAMS_ROUTE) if ((a->fd = open("/dev/route", O_WRONLY, 0)) < 0) #else if ((a->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) #endif return (arp_close(a)); #ifdef HAVE_ARPREQ_ARP_DEV if ((a->intf = intf_open()) == NULL) return (arp_close(a)); #endif } return (a); } #ifdef HAVE_ARPREQ_ARP_DEV static int _arp_set_dev(const struct intf_entry *entry, void *arg) { struct arpreq *ar = (struct arpreq *)arg; struct addr dst; uint32_t mask; if (entry->intf_type == INTF_TYPE_ETH && entry->intf_addr.addr_type == ADDR_TYPE_IP) { addr_btom(entry->intf_addr.addr_bits, &mask, IP_ADDR_LEN); addr_ston((struct sockaddr *)&ar->arp_pa, &dst); if ((entry->intf_addr.addr_ip & mask) == (dst.addr_ip & mask)) { strlcpy(ar->arp_dev, entry->intf_name, sizeof(ar->arp_dev)); return (1); } } return (0); } #endif int arp_add(arp_t *a, const struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); /* XXX - see arp(7) for details... */ #ifdef __linux__ if (addr_ntos(&entry->arp_ha, &ar.arp_ha) < 0) return (-1); ar.arp_ha.sa_family = ARP_HRD_ETH; #else /* XXX - Solaris, HP-UX, IRIX, other Mentat stacks? */ ar.arp_ha.sa_family = AF_UNSPEC; memcpy(ar.arp_ha.sa_data, &entry->arp_ha.addr_eth, ETH_ADDR_LEN); #endif #ifdef HAVE_ARPREQ_ARP_DEV if (intf_loop(a->intf, _arp_set_dev, &ar) != 1) { errno = ESRCH; return (-1); } #endif ar.arp_flags = ATF_PERM | ATF_COM; #ifdef hpux /* XXX - screwy extended arpreq struct */ { struct sockaddr_in *sin; ar.arp_hw_addr_len = ETH_ADDR_LEN; sin = (struct sockaddr_in *)&ar.arp_pa_mask; sin->sin_family = AF_INET; sin->sin_addr.s_addr = IP_ADDR_BROADCAST; } #endif if (ioctl(a->fd, SIOCSARP, &ar) < 0) return (-1); #ifdef HAVE_STREAMS_MIB2 /* XXX - force entry into ipNetToMediaTable. */ { struct sockaddr_in sin; int fd; addr_ntos(&entry->arp_pa, (struct sockaddr *)&sin); sin.sin_port = htons(666); if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (-1); if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { close(fd); return (-1); } write(fd, NULL, 0); close(fd); } #endif return (0); } int arp_delete(arp_t *a, const struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); if (ioctl(a->fd, SIOCDARP, &ar) < 0) return (-1); return (0); } int arp_get(arp_t *a, struct arp_entry *entry) { struct arpreq ar; memset(&ar, 0, sizeof(ar)); if (addr_ntos(&entry->arp_pa, &ar.arp_pa) < 0) return (-1); #ifdef HAVE_ARPREQ_ARP_DEV if (intf_loop(a->intf, _arp_set_dev, &ar) != 1) { errno = ESRCH; return (-1); } #endif if (ioctl(a->fd, SIOCGARP, &ar) < 0) return (-1); if ((ar.arp_flags & ATF_COM) == 0) { errno = ESRCH; return (-1); } return (addr_ston(&ar.arp_ha, &entry->arp_ha)); } #ifdef HAVE_LINUX_PROCFS int arp_loop(arp_t *a, arp_handler callback, void *arg) { FILE *fp; struct arp_entry entry; char buf[BUFSIZ], ipbuf[100], macbuf[100], maskbuf[100], devbuf[100]; int i, type, flags, ret; if ((fp = fopen(PROC_ARP_FILE, "r")) == NULL) return (-1); ret = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { i = sscanf(buf, "%s 0x%x 0x%x %100s %100s %100s\n", ipbuf, &type, &flags, macbuf, maskbuf, devbuf); if (i < 4 || (flags & ATF_COM) == 0) continue; if (addr_aton(ipbuf, &entry.arp_pa) == 0 && addr_aton(macbuf, &entry.arp_ha) == 0) { if ((ret = callback(&entry, arg)) != 0) break; } } if (ferror(fp)) { fclose(fp); return (-1); } fclose(fp); return (ret); } #elif defined (HAVE_STREAMS_MIB2) int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct arp_entry entry; struct strbuf msg; struct T_optmgmt_req *tor; struct T_optmgmt_ack *toa; struct T_error_ack *tea; struct opthdr *opt; mib2_ipNetToMediaEntry_t *arp, *arpend; u_char buf[8192]; int flags, rc, atable, ret; tor = (struct T_optmgmt_req *)buf; toa = (struct T_optmgmt_ack *)buf; tea = (struct T_error_ack *)buf; tor->PRIM_type = T_OPTMGMT_REQ; tor->OPT_offset = sizeof(*tor); tor->OPT_length = sizeof(*opt); tor->MGMT_flags = T_CURRENT; opt = (struct opthdr *)(tor + 1); opt->level = MIB2_IP; opt->name = opt->len = 0; msg.maxlen = sizeof(buf); msg.len = sizeof(*tor) + sizeof(*opt); msg.buf = buf; if (putmsg(r->fd, &msg, NULL, 0) < 0) return (-1); opt = (struct opthdr *)(toa + 1); msg.maxlen = sizeof(buf); for (;;) { flags = 0; if ((rc = getmsg(r->fd, &msg, NULL, &flags)) < 0) return (-1); /* See if we're finished. */ if (rc == 0 && msg.len >= sizeof(*toa) && toa->PRIM_type == T_OPTMGMT_ACK && toa->MGMT_flags == T_SUCCESS && opt->len == 0) break; if (msg.len >= sizeof(*tea) && tea->PRIM_type == T_ERROR_ACK) return (-1); if (rc != MOREDATA || msg.len < (int)sizeof(*toa) || toa->PRIM_type != T_OPTMGMT_ACK || toa->MGMT_flags != T_SUCCESS) return (-1); atable = (opt->level == MIB2_IP && opt->name == MIB2_IP_22); msg.maxlen = sizeof(buf) - (sizeof(buf) % sizeof(*arp)); msg.len = 0; flags = 0; do { rc = getmsg(r->fd, NULL, &msg, &flags); if (rc != 0 && rc != MOREDATA) return (-1); if (!atable) continue; arp = (mib2_ipNetToMediaEntry_t *)msg.buf; arpend = (mib2_ipNetToMediaEntry_t *) (msg.buf + msg.len); entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; for ( ; arp < arpend; arp++) { entry.arp_pa.addr_ip = arp->ipNetToMediaNetAddress; memcpy(&entry.arp_ha.addr_eth, arp->ipNetToMediaPhysAddress.o_bytes, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) return (ret); } } while (rc == MOREDATA); } return (0); } #elif defined(HAVE_SYS_MIB_H) #define MAX_ARPENTRIES 512 /* XXX */ int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct nmparms nm; struct arp_entry entry; mib_ipNetToMediaEnt arpentries[MAX_ARPENTRIES]; int fd, i, n, ret; if ((fd = open_mib("/dev/ip", O_RDWR, 0 /* XXX */, 0)) < 0) return (-1); nm.objid = ID_ipNetToMediaTable; nm.buffer = arpentries; n = sizeof(arpentries); nm.len = &n; if (get_mib_info(fd, &nm) < 0) { close_mib(fd); return (-1); } close_mib(fd); entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; n /= sizeof(*arpentries); ret = 0; for (i = 0; i < n; i++) { if (arpentries[i].Type == INTM_INVALID || arpentries[i].PhysAddr.o_length != ETH_ADDR_LEN) continue; entry.arp_pa.addr_ip = arpentries[i].NetAddr; memcpy(&entry.arp_ha.addr_eth, arpentries[i].PhysAddr.o_bytes, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) break; } return (ret); } #elif defined(HAVE_NET_RADIX_H) /* XXX - Tru64, others? */ #include #include static int _kread(int fd, void *addr, void *buf, int len) { if (lseek(fd, (off_t)addr, SEEK_SET) == (off_t)-1L) return (-1); return (read(fd, buf, len) == len ? 0 : -1); } static int _radix_walk(int fd, struct radix_node *rn, arp_handler callback, void *arg) { struct radix_node rnode; struct rtentry rt; struct sockaddr_in sin; struct arptab at; struct arp_entry entry; int ret = 0; again: _kread(fd, rn, &rnode, sizeof(rnode)); if (rnode.rn_b < 0) { if (!(rnode.rn_flags & RNF_ROOT)) { _kread(fd, rn, &rt, sizeof(rt)); _kread(fd, rt_key(&rt), &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.arp_pa); _kread(fd, rt.rt_llinfo, &at, sizeof(at)); if (at.at_flags & ATF_COM) { addr_pack(&entry.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS, at.at_hwaddr, ETH_ADDR_LEN); if ((ret = callback(&entry, arg)) != 0) return (ret); } } if ((rn = rnode.rn_dupedkey)) goto again; } else { rn = rnode.rn_r; if ((ret = _radix_walk(fd, rnode.rn_l, callback, arg)) != 0) return (ret); if ((ret = _radix_walk(fd, rn, callback, arg)) != 0) return (ret); } return (ret); } int arp_loop(arp_t *r, arp_handler callback, void *arg) { struct ifnet *ifp, ifnet; struct ifnet_arp_cache_head ifarp; struct radix_node_head *head; struct nlist nl[2]; int fd, ret = 0; memset(nl, 0, sizeof(nl)); nl[0].n_name = "ifnet"; if (knlist(nl) < 0 || nl[0].n_type == 0 || (fd = open("/dev/kmem", O_RDONLY, 0)) < 0) return (-1); for (ifp = (struct ifnet *)nl[0].n_value; ifp != NULL; ifp = ifnet.if_next) { _kread(fd, ifp, &ifnet, sizeof(ifnet)); if (ifnet.if_arp_cache_head != NULL) { _kread(fd, ifnet.if_arp_cache_head, &ifarp, sizeof(ifarp)); /* XXX - only ever one rnh, only ever AF_INET. */ if ((ret = _radix_walk(fd, ifarp.arp_cache_head.rnh_treetop, callback, arg)) != 0) break; } } close(fd); return (ret); } #else int arp_loop(arp_t *a, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif arp_t * arp_close(arp_t *a) { if (a != NULL) { if (a->fd >= 0) close(a->fd); #ifdef HAVE_ARPREQ_ARP_DEV if (a->intf != NULL) intf_close(a->intf); #endif free(a); } return (NULL); } libdnet-1.12/trunk/src/arp-none.c0000644000076500007650000000132207426663775020067 0ustar dugsongdugsong00000000000000/* * arp-none.c * * Copyright (c) 2000 Dug Song * * $Id: arp-none.c 252 2002-02-02 04:15:57Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" arp_t * arp_open(void) { errno = ENOSYS; return (NULL); } int arp_add(arp_t *a, const struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_delete(arp_t *a, const struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_get(arp_t *a, struct arp_entry *entry) { errno = ENOSYS; return (-1); } int arp_loop(arp_t *a, arp_handler callback, void *arg) { errno = ENOSYS; return (-1); } arp_t * arp_close(arp_t *a) { return (NULL); } libdnet-1.12/trunk/src/arp-win32.c0000644000076500007650000000534710174652026020062 0ustar dugsongdugsong00000000000000/* * arp-win32.c * * Copyright (c) 2002 Dug Song * * $Id: arp-win32.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" struct arp_handle { MIB_IPNETTABLE *iptable; }; arp_t * arp_open(void) { return (calloc(1, sizeof(arp_t))); } int arp_add(arp_t *arp, const struct arp_entry *entry) { MIB_IPFORWARDROW ipfrow; MIB_IPNETROW iprow; if (GetBestRoute(entry->arp_pa.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); iprow.dwIndex = ipfrow.dwForwardIfIndex; iprow.dwPhysAddrLen = ETH_ADDR_LEN; memcpy(iprow.bPhysAddr, &entry->arp_ha.addr_eth, ETH_ADDR_LEN); iprow.dwAddr = entry->arp_pa.addr_ip; iprow.dwType = 4; /* XXX - static */ if (CreateIpNetEntry(&iprow) != NO_ERROR) return (-1); return (0); } int arp_delete(arp_t *arp, const struct arp_entry *entry) { MIB_IPFORWARDROW ipfrow; MIB_IPNETROW iprow; if (GetBestRoute(entry->arp_pa.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); memset(&iprow, 0, sizeof(iprow)); iprow.dwIndex = ipfrow.dwForwardIfIndex; iprow.dwAddr = entry->arp_pa.addr_ip; if (DeleteIpNetEntry(&iprow) != NO_ERROR) { errno = ENXIO; return (-1); } return (0); } static int _arp_get_entry(const struct arp_entry *entry, void *arg) { struct arp_entry *e = (struct arp_entry *)arg; if (addr_cmp(&entry->arp_pa, &e->arp_pa) == 0) { memcpy(&e->arp_ha, &entry->arp_ha, sizeof(e->arp_ha)); return (1); } return (0); } int arp_get(arp_t *arp, struct arp_entry *entry) { if (arp_loop(arp, _arp_get_entry, entry) != 1) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } return (0); } int arp_loop(arp_t *arp, arp_handler callback, void *arg) { struct arp_entry entry; ULONG len; int i, ret; for (len = sizeof(arp->iptable[0]); ; ) { if (arp->iptable) free(arp->iptable); arp->iptable = malloc(len); ret = GetIpNetTable(arp->iptable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } entry.arp_pa.addr_type = ADDR_TYPE_IP; entry.arp_pa.addr_bits = IP_ADDR_BITS; entry.arp_ha.addr_type = ADDR_TYPE_ETH; entry.arp_ha.addr_bits = ETH_ADDR_BITS; for (i = 0; i < (int)arp->iptable->dwNumEntries; i++) { if (arp->iptable->table[i].dwPhysAddrLen != ETH_ADDR_LEN) continue; entry.arp_pa.addr_ip = arp->iptable->table[i].dwAddr; memcpy(&entry.arp_ha.addr_eth, arp->iptable->table[i].bPhysAddr, ETH_ADDR_LEN); if ((ret = (*callback)(&entry, arg)) != 0) return (ret); } return (0); } arp_t * arp_close(arp_t *arp) { if (arp != NULL) { if (arp->iptable != NULL) free(arp->iptable); free(arp); } return (NULL); } libdnet-1.12/trunk/src/blob.c0000644000076500007650000002066310360234231017243 0ustar dugsongdugsong00000000000000/* * blob.c * * Copyright (c) 2002 Dug Song * * $Id: blob.c 615 2006-01-08 16:06:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" static void *(*bl_malloc)(size_t) = malloc; static void *(*bl_realloc)(void *, size_t) = realloc; static void (*bl_free)(void *) = free; static int bl_size = BUFSIZ; static int fmt_D(int, int, blob_t *, va_list *); static int fmt_H(int, int, blob_t *, va_list *); static int fmt_b(int, int, blob_t *, va_list *); static int fmt_c(int, int, blob_t *, va_list *); static int fmt_d(int, int, blob_t *, va_list *); static int fmt_h(int, int, blob_t *, va_list *); static int fmt_s(int, int, blob_t *, va_list *); static void print_hexl(blob_t *); static blob_fmt_cb blob_ascii_fmt[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_D, NULL, NULL, NULL, fmt_H, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_b, fmt_c, fmt_d, NULL, NULL, NULL, fmt_h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, fmt_s, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; struct blob_printer { char *name; void (*print)(blob_t *); } blob_printers[] = { { "hexl", print_hexl }, { NULL, NULL }, }; blob_t * blob_new(void) { blob_t *b; if ((b = bl_malloc(sizeof(*b))) != NULL) { b->off = b->end = 0; b->size = bl_size; if ((b->base = bl_malloc(b->size)) == NULL) { bl_free(b); b = NULL; } } return (b); } static int blob_reserve(blob_t *b, int len) { void *p; int nsize; if (b->size < b->end + len) { if (b->size == 0) return (-1); if ((nsize = b->end + len) > bl_size) nsize = ((nsize / bl_size) + 1) * bl_size; if ((p = bl_realloc(b->base, nsize)) == NULL) return (-1); b->base = p; b->size = nsize; } b->end += len; return (0); } int blob_read(blob_t *b, void *buf, int len) { if (b->end - b->off < len) len = b->end - b->off; memcpy(buf, b->base + b->off, len); b->off += len; return (len); } int blob_write(blob_t *b, const void *buf, int len) { if (b->off + len <= b->end || blob_reserve(b, b->off + len - b->end) == 0) { memcpy(b->base + b->off, (u_char *)buf, len); b->off += len; return (len); } return (-1); } int blob_insert(blob_t *b, const void *buf, int len) { if (blob_reserve(b, len) == 0 && b->size) { if (b->end - b->off > 0) memmove( b->base + b->off + len, b->base + b->off, b->end - b->off); memcpy(b->base + b->off, buf, len); b->off += len; return (len); } return (-1); } int blob_delete(blob_t *b, void *buf, int len) { if (b->off + len <= b->end && b->size) { if (buf != NULL) memcpy(buf, b->base + b->off, len); memmove(b->base + b->off, b->base + b->off + len, b->end - (b->off + len)); b->end -= len; return (len); } return (-1); } static int blob_fmt(blob_t *b, int pack, const char *fmt, va_list *ap) { blob_fmt_cb fmt_cb; char *p; int len; for (p = (char *)fmt; *p != '\0'; p++) { if (*p == '%') { p++; if (isdigit((int)*p)) { len = strtol(p, &p, 10); } else if (*p == '*') { len = va_arg(*ap, int); p++; } else len = 0; if ((fmt_cb = blob_ascii_fmt[(int)*p]) == NULL) return (-1); if ((*fmt_cb)(pack, len, b, ap) < 0) return (-1); } else { if (pack) { if (b->off + 1 < b->end || blob_reserve(b, b->off + 1 - b->end) == 0) b->base[b->off++] = *p; else return (-1); } else { if (b->base[b->off++] != *p) return (-1); } } } return (0); } int blob_pack(blob_t *b, const char *fmt, ...) { va_list ap; va_start(ap, fmt); return (blob_fmt(b, 1, fmt, &ap)); } int blob_unpack(blob_t *b, const char *fmt, ...) { va_list ap; va_start(ap, fmt); return (blob_fmt(b, 0, fmt, &ap)); } int blob_seek(blob_t *b, int off, int whence) { if (whence == SEEK_CUR) off += b->off; else if (whence == SEEK_END) off += b->end; if (off < 0 || off > b->end) return (-1); return ((b->off = off)); } int blob_index(blob_t *b, const void *buf, int len) { int i; for (i = b->off; i <= b->end - len; i++) { if (memcmp(b->base + i, buf, len) == 0) return (i); } return (-1); } int blob_rindex(blob_t *b, const void *buf, int len) { int i; for (i = b->end - len; i >= 0; i--) { if (memcmp(b->base + i, buf, len) == 0) return (i); } return (-1); } int blob_print(blob_t *b, char *style, int len) { struct blob_printer *bp; for (bp = blob_printers; bp->name != NULL; bp++) { if (strcmp(bp->name, style) == 0) bp->print(b); } return (0); } int blob_sprint(blob_t *b, char *style, int len, char *dst, int size) { return (0); } blob_t * blob_free(blob_t *b) { if (b->size) bl_free(b->base); bl_free(b); return (NULL); } int blob_register_alloc(size_t size, void *(bmalloc)(size_t), void (*bfree)(void *), void *(*brealloc)(void *, size_t)) { bl_size = size; if (bmalloc != NULL) bl_malloc = bmalloc; if (bfree != NULL) bl_free = bfree; if (brealloc != NULL) bl_realloc = brealloc; return (0); } int blob_register_pack(char c, blob_fmt_cb fmt_cb) { if (blob_ascii_fmt[(int)c] == NULL) { blob_ascii_fmt[(int)c] = fmt_cb; return (0); } return (-1); } static int fmt_D(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint32_t n = va_arg(*ap, uint32_t); n = htonl(n); if (blob_write(b, &n, sizeof(n)) < 0) return (-1); } else { uint32_t *n = va_arg(*ap, uint32_t *); if (blob_read(b, n, sizeof(*n)) != sizeof(*n)) return (-1); *n = ntohl(*n); } return (0); } static int fmt_H(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint16_t n = va_arg(*ap, int); n = htons(n); if (blob_write(b, &n, sizeof(n)) < 0) return (-1); } else { uint16_t *n = va_arg(*ap, uint16_t *); if (blob_read(b, n, sizeof(*n)) != sizeof(*n)) return (-1); *n = ntohs(*n); } return (0); } static int fmt_b(int pack, int len, blob_t *b, va_list *ap) { void *p = va_arg(*ap, void *); if (len <= 0) return (-1); if (pack) return (blob_write(b, p, len)); else return (blob_read(b, p, len)); } static int fmt_c(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint8_t n = va_arg(*ap, int); return (blob_write(b, &n, sizeof(n))); } else { uint8_t *n = va_arg(*ap, uint8_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_d(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint32_t n = va_arg(*ap, uint32_t); return (blob_write(b, &n, sizeof(n))); } else { uint32_t *n = va_arg(*ap, uint32_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_h(int pack, int len, blob_t *b, va_list *ap) { if (len) return (-1); if (pack) { uint16_t n = va_arg(*ap, int); return (blob_write(b, &n, sizeof(n))); } else { uint16_t *n = va_arg(*ap, uint16_t *); return (blob_read(b, n, sizeof(*n))); } } static int fmt_s(int pack, int len, blob_t *b, va_list *ap) { char *p = va_arg(*ap, char *); char c = '\0'; int i, end; if (pack) { if (len > 0) { if ((c = p[len - 1]) != '\0') p[len - 1] = '\0'; } else len = strlen(p) + 1; if (blob_write(b, p, len) > 0) { if (c != '\0') p[len - 1] = c; return (len); } } else { if (len <= 0) return (-1); if ((end = b->end - b->off) < len) end = len; for (i = 0; i < end; i++) { if ((p[i] = b->base[b->off + i]) == '\0') { b->off += i + 1; return (i); } } } return (-1); } static void print_hexl(blob_t *b) { u_int i, j, jm, len; u_char *p; int c; p = b->base + b->off; len = b->end - b->off; printf("\n"); for (i = 0; i < len; i += 0x10) { printf(" %04x: ", (u_int)(i + b->off)); jm = len - i; jm = jm > 16 ? 16 : jm; for (j = 0; j < jm; j++) { printf((j % 2) ? "%02x " : "%02x", (u_int)p[i + j]); } for (; j < 16; j++) { printf((j % 2) ? " " : " "); } printf(" "); for (j = 0; j < jm; j++) { c = p[i + j]; printf("%c", isprint(c) ? c : '.'); } printf("\n"); } } libdnet-1.12/trunk/src/err.c0000644000076500007650000000601410045605717017122 0ustar dugsongdugsong00000000000000/* * err.c * * Adapted from OpenBSD libc *err* *warn* code. * * Copyright (c) 2000 Dug Song * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef _WIN32 #include #endif #include #include #include #include #include void err(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) { (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ": "); } va_end(ap); #ifdef _WIN32 (void)fprintf(stderr, "error %lu\n", GetLastError()); #else (void)fprintf(stderr, "%s\n", strerror(errno)); #endif exit(eval); } void warn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) { (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ": "); } va_end(ap); #ifdef _WIN32 (void)fprintf(stderr, "error %lu\n", GetLastError()); #else (void)fprintf(stderr, "%s\n", strerror(errno)); #endif } void errx(int eval, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); va_end(ap); exit(eval); } void warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); va_end(ap); } libdnet-1.12/trunk/src/eth-bsd.c0000644000076500007650000000607310370303743017660 0ustar dugsongdugsong00000000000000/* * eth-bsd.c * * Copyright (c) 2001 Dug Song * * $Id: eth-bsd.c 630 2006-02-02 04:17:39Z dugsong $ */ #include "config.h" #include #include #include #include #include #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_ROUTE_RT_MSGHDR) #include #include #include #endif #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; char device[16]; }; eth_t * eth_open(const char *device) { struct ifreq ifr; char file[32]; eth_t *e; int i; if ((e = calloc(1, sizeof(*e))) != NULL) { for (i = 0; i < 128; i++) { snprintf(file, sizeof(file), "/dev/bpf%d", i); e->fd = open(file, O_WRONLY); if (e->fd != -1 || errno != EBUSY) break; } if (e->fd < 0) return (eth_close(e)); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)); if (ioctl(e->fd, BIOCSETIF, (char *)&ifr) < 0) return (eth_close(e)); #ifdef BIOCSHDRCMPLT i = 1; if (ioctl(e->fd, BIOCSHDRCMPLT, &i) < 0) return (eth_close(e)); #endif strlcpy(e->device, device, sizeof(e->device)); } return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } #if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_ROUTE_RT_MSGHDR) int eth_get(eth_t *e, eth_addr_t *ea) { struct if_msghdr *ifm; struct sockaddr_dl *sdl; struct addr ha; u_char *p, *buf; size_t len; int mib[] = { CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0 }; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } for (p = buf; p < buf + len; p += ifm->ifm_msglen) { ifm = (struct if_msghdr *)p; sdl = (struct sockaddr_dl *)(ifm + 1); if (ifm->ifm_type != RTM_IFINFO || (ifm->ifm_addrs & RTA_IFP) == 0) continue; if (sdl->sdl_family != AF_LINK || sdl->sdl_nlen == 0 || memcmp(sdl->sdl_data, e->device, sdl->sdl_nlen) != 0) continue; if (addr_ston((struct sockaddr *)sdl, &ha) == 0) break; } free(buf); if (p >= buf + len) { errno = ESRCH; return (-1); } memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } #else int eth_get(eth_t *e, eth_addr_t *ea) { errno = ENOSYS; return (-1); } #endif #if defined(SIOCSIFLLADDR) int eth_set(eth_t *e, const eth_addr_t *ea) { struct ifreq ifr; struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, e->device, sizeof(ifr.ifr_name)); addr_ntos(&ha, &ifr.ifr_addr); return (ioctl(e->fd, SIOCSIFLLADDR, &ifr)); } #else int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } #endif libdnet-1.12/trunk/src/eth-dlpi.c0000644000076500007650000001406110202710144020023 0ustar dugsongdugsong00000000000000/* * eth-dlpi.c * * Based on Neal Nuckolls' 1992 "How to Use DLPI" paper. * * Copyright (c) 2001 Dug Song * * $Id: eth-dlpi.c 560 2005-02-10 16:48:36Z dugsong $ */ #include "config.h" #include #ifdef HAVE_SYS_BUFMOD_H #include #endif #ifdef HAVE_SYS_DLPI_H #include #elif defined(HAVE_SYS_DLPIHDR_H) #include #endif #ifdef HAVE_SYS_DLPI_EXT_H #include #endif #include #include #include #include #include #include #include #include #include #include "dnet.h" #ifndef INFTIM #define INFTIM -1 #endif struct eth_handle { int fd; int sap_len; }; static int dlpi_msg(int fd, union DL_primitives *dlp, int rlen, int flags, int ack, int alen, int size) { struct strbuf ctl; ctl.maxlen = 0; ctl.len = rlen; ctl.buf = (caddr_t)dlp; if (putmsg(fd, &ctl, NULL, flags) < 0) return (-1); ctl.maxlen = size; ctl.len = 0; flags = 0; if (getmsg(fd, &ctl, NULL, &flags) < 0) return (-1); if (dlp->dl_primitive != ack || ctl.len < alen) return (-1); return (0); } #if defined(DLIOCRAW) || defined(HAVE_SYS_DLPIHDR_H) static int strioctl(int fd, int cmd, int len, char *dp) { struct strioctl str; str.ic_cmd = cmd; str.ic_timout = INFTIM; str.ic_len = len; str.ic_dp = dp; if (ioctl(fd, I_STR, &str) < 0) return (-1); return (str.ic_len); } #endif #ifdef HAVE_SYS_DLPIHDR_H /* XXX - OSF1 is nuts */ #define ND_GET ('N' << 8 + 0) static int eth_match_ppa(eth_t *e, const char *device) { char *p, dev[16], buf[256]; int len, ppa; strlcpy(buf, "dl_ifnames", sizeof(buf)); if ((len = strioctl(e->fd, ND_GET, sizeof(buf), buf)) < 0) return (-1); for (p = buf; p < buf + len; p += strlen(p) + 1) { ppa = -1; if (sscanf(p, "%s (PPA %d)\n", dev, &ppa) != 2) break; if (strcmp(dev, device) == 0) break; } return (ppa); } #endif eth_t * eth_open(const char *device) { union DL_primitives *dlp; uint32_t buf[8192]; char *p, dev[16]; eth_t *e; int ppa; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); #ifdef HAVE_SYS_DLPIHDR_H if ((e->fd = open("/dev/streams/dlb", O_RDWR)) < 0) return (eth_close(e)); if ((ppa = eth_match_ppa(e, device)) < 0) { errno = ESRCH; return (eth_close(e)); } #else e->fd = -1; snprintf(dev, sizeof(dev), "/dev/%s", device); if ((p = strpbrk(dev, "0123456789")) == NULL) { errno = EINVAL; return (eth_close(e)); } ppa = atoi(p); *p = '\0'; if ((e->fd = open(dev, O_RDWR)) < 0) { snprintf(dev, sizeof(dev), "/dev/%s", device); if ((e->fd = open(dev, O_RDWR)) < 0) return (eth_close(e)); } #endif dlp = (union DL_primitives *)buf; dlp->info_req.dl_primitive = DL_INFO_REQ; if (dlpi_msg(e->fd, dlp, DL_INFO_REQ_SIZE, RS_HIPRI, DL_INFO_ACK, DL_INFO_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); e->sap_len = dlp->info_ack.dl_sap_length; if (dlp->info_ack.dl_provider_style == DL_STYLE2) { dlp->attach_req.dl_primitive = DL_ATTACH_REQ; dlp->attach_req.dl_ppa = ppa; if (dlpi_msg(e->fd, dlp, DL_ATTACH_REQ_SIZE, 0, DL_OK_ACK, DL_OK_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); } memset(&dlp->bind_req, 0, DL_BIND_REQ_SIZE); dlp->bind_req.dl_primitive = DL_BIND_REQ; #ifdef DL_HP_RAWDLS dlp->bind_req.dl_sap = 24; /* from HP-UX DLPI programmers guide */ dlp->bind_req.dl_service_mode = DL_HP_RAWDLS; #else dlp->bind_req.dl_sap = DL_ETHER; dlp->bind_req.dl_service_mode = DL_CLDLS; #endif if (dlpi_msg(e->fd, dlp, DL_BIND_REQ_SIZE, 0, DL_BIND_ACK, DL_BIND_ACK_SIZE, sizeof(buf)) < 0) return (eth_close(e)); #ifdef DLIOCRAW if (strioctl(e->fd, DLIOCRAW, 0, NULL) < 0) return (eth_close(e)); #endif return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { #if defined(DLIOCRAW) return (write(e->fd, buf, len)); #else union DL_primitives *dlp; struct strbuf ctl, data; struct eth_hdr *eth; uint32_t ctlbuf[8192]; u_char sap[4] = { 0, 0, 0, 0 }; int dlen; dlp = (union DL_primitives *)ctlbuf; #ifdef DL_HP_RAWDATA_REQ dlp->dl_primitive = DL_HP_RAWDATA_REQ; dlen = DL_HP_RAWDATA_REQ_SIZE; #else dlp->unitdata_req.dl_primitive = DL_UNITDATA_REQ; dlp->unitdata_req.dl_dest_addr_length = ETH_ADDR_LEN; dlp->unitdata_req.dl_dest_addr_offset = DL_UNITDATA_REQ_SIZE; dlp->unitdata_req.dl_priority.dl_min = dlp->unitdata_req.dl_priority.dl_max = 0; dlen = DL_UNITDATA_REQ_SIZE; #endif eth = (struct eth_hdr *)buf; *(uint16_t *)sap = ntohs(eth->eth_type); /* XXX - DLSAP setup logic from ISC DHCP */ ctl.maxlen = 0; ctl.len = dlen + ETH_ADDR_LEN + abs(e->sap_len); ctl.buf = (char *)ctlbuf; if (e->sap_len >= 0) { memcpy(ctlbuf + dlen, sap, e->sap_len); memcpy(ctlbuf + dlen + e->sap_len, eth->eth_dst.data, ETH_ADDR_LEN); } else { memcpy(ctlbuf + dlen, eth->eth_dst.data, ETH_ADDR_LEN); memcpy(ctlbuf + dlen + ETH_ADDR_LEN, sap, abs(e->sap_len)); } data.maxlen = 0; data.len = len; data.buf = (char *)buf; if (putmsg(e->fd, &ctl, &data, 0) < 0) return (-1); return (len); #endif } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { union DL_primitives *dlp; u_char buf[2048]; dlp = (union DL_primitives *)buf; dlp->physaddr_req.dl_primitive = DL_PHYS_ADDR_REQ; dlp->physaddr_req.dl_addr_type = DL_CURR_PHYS_ADDR; if (dlpi_msg(e->fd, dlp, DL_PHYS_ADDR_REQ_SIZE, 0, DL_PHYS_ADDR_ACK, DL_PHYS_ADDR_ACK_SIZE, sizeof(buf)) < 0) return (-1); memcpy(ea, buf + dlp->physaddr_ack.dl_addr_offset, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { union DL_primitives *dlp; u_char buf[2048]; dlp = (union DL_primitives *)buf; dlp->set_physaddr_req.dl_primitive = DL_SET_PHYS_ADDR_REQ; dlp->set_physaddr_req.dl_addr_length = ETH_ADDR_LEN; dlp->set_physaddr_req.dl_addr_offset = DL_SET_PHYS_ADDR_REQ_SIZE; memcpy(buf + DL_SET_PHYS_ADDR_REQ_SIZE, ea, sizeof(*ea)); return (dlpi_msg(e->fd, dlp, DL_SET_PHYS_ADDR_REQ_SIZE + ETH_ADDR_LEN, 0, DL_OK_ACK, DL_OK_ACK_SIZE, sizeof(buf))); } libdnet-1.12/trunk/src/eth-linux.c0000644000076500007650000000413110175535200020236 0ustar dugsongdugsong00000000000000/* * eth-linux.c * * Copyright (c) 2000 Dug Song * * $Id: eth-linux.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 #include #include #else #include #include #include #endif /* __GLIBC__ */ #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; struct ifreq ifr; struct sockaddr_ll sll; }; eth_t * eth_open(const char *device) { eth_t *e; int n; if ((e = calloc(1, sizeof(*e))) != NULL) { if ((e->fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) < 0) return (eth_close(e)); #ifdef SO_BROADCAST n = 1; if (setsockopt(e->fd, SOL_SOCKET, SO_BROADCAST, &n, sizeof(n)) < 0) return (eth_close(e)); #endif strlcpy(e->ifr.ifr_name, device, sizeof(e->ifr.ifr_name)); if (ioctl(e->fd, SIOCGIFINDEX, &e->ifr) < 0) return (eth_close(e)); e->sll.sll_family = AF_PACKET; e->sll.sll_ifindex = e->ifr.ifr_ifindex; } return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { struct eth_hdr *eth = (struct eth_hdr *)buf; e->sll.sll_protocol = eth->eth_type; return (sendto(e->fd, buf, len, 0, (struct sockaddr *)&e->sll, sizeof(e->sll))); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { struct addr ha; if (ioctl(e->fd, SIOCGIFHWADDR, &e->ifr) < 0) return (-1); if (addr_ston(&e->ifr.ifr_hwaddr, &ha) < 0) return (-1); memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); addr_ntos(&ha, &e->ifr.ifr_hwaddr); return (ioctl(e->fd, SIOCSIFHWADDR, &e->ifr)); } libdnet-1.12/trunk/src/eth-ndd.c0000644000076500007650000000412610175535200017650 0ustar dugsongdugsong00000000000000/* * eth-ndd.c * * Copyright (c) 2001 Dug Song * * $Id: eth-ndd.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { char device[16]; int fd; }; eth_t * eth_open(const char *device) { struct sockaddr_ndd_8022 sa; eth_t *e; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); if ((e->fd = socket(AF_NDD, SOCK_DGRAM, NDD_PROT_ETHER)) < 0) return (eth_close(e)); sa.sndd_8022_family = AF_NDD; sa.sndd_8022_len = sizeof(sa); sa.sndd_8022_filtertype = NS_ETHERTYPE; sa.sndd_8022_ethertype = ETH_TYPE_IP; sa.sndd_8022_filterlen = sizeof(struct ns_8022); strlcpy(sa.sndd_8022_nddname, device, sizeof(sa.sndd_8022_nddname)); if (bind(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) return (eth_close(e)); if (connect(e->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) return (eth_close(e)); /* XXX - SO_BROADCAST needed? */ return (e); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { struct kinfo_ndd *nddp; int size; void *end; if ((size = getkerninfo(KINFO_NDD, 0, 0, 0)) == 0) { errno = ENOENT; return (-1); } else if (size < 0) return (-1); if ((nddp = malloc(size)) == NULL) return (-1); if (getkerninfo(KINFO_NDD, nddp, &size, 0) < 0) { free(nddp); return (-1); } for (end = (void *)nddp + size; (void *)nddp < end; nddp++) { if (strcmp(nddp->ndd_alias, e->device) == 0 || strcmp(nddp->ndd_name, e->device) == 0) { memcpy(ea, nddp->ndd_addr, sizeof(*ea)); } } free(nddp); if ((void *)nddp >= end) { errno = ESRCH; return (-1); } return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } libdnet-1.12/trunk/src/eth-none.c0000644000076500007650000000116210175535200020037 0ustar dugsongdugsong00000000000000/* * eth-none.c * * Copyright (c) 2000 Dug Song * * $Id: eth-none.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" eth_t * eth_open(const char *device) { errno = ENOSYS; return (NULL); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { errno = ENOSYS; return (-1); } eth_t * eth_close(eth_t *e) { return (NULL); } int eth_get(eth_t *e, eth_addr_t *ea) { errno = ENOSYS; return (-1); } int eth_set(eth_t *e, const eth_addr_t *ea) { errno = ENOSYS; return (-1); } libdnet-1.12/trunk/src/eth-pfilt.c0000644000076500007650000000276610202712234020224 0ustar dugsongdugsong00000000000000/* * eth-pfilt.c * * XXX - requires 'cd dev && ./MAKEDEV pfilt' if not already configured... * * Copyright (c) 2001 Dug Song * * $Id: eth-pfilt.c 563 2005-02-10 17:06:36Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; int sock; char device[16]; }; eth_t * eth_open(const char *device) { struct eth_handle *e; int fd; if ((e = calloc(1, sizeof(*e))) != NULL) { strlcpy(e->device, device, sizeof(e->device)); if ((e->fd = pfopen(e->device, O_WRONLY)) < 0 || (e->sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) e = eth_close(e); } return (e); } int eth_get(eth_t *e, eth_addr_t *ea) { struct ifdevea ifd; strlcpy(ifd.ifr_name, e->device, sizeof(ifd.ifr_name)); if (ioctl(e->sock, SIOCRPHYSADDR, &ifd) < 0) return (-1); memcpy(ea, ifd.current_pa, ETH_ADDR_LEN); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct ifdevea ifd; strlcpy(ifd.ifr_name, e->device, sizeof(ifd.ifr_name)); memcpy(ifd.current_pa, ea, ETH_ADDR_LEN); return (ioctl(e->sock, SIOCSPHYSADDR, &ifd)); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); if (e->sock >= 0) close(e->sock); free(e); } return (NULL); } libdnet-1.12/trunk/src/eth-snoop.c0000644000076500007650000000345110177074125020247 0ustar dugsongdugsong00000000000000/* * eth-snoop.c * * Copyright (c) 2000 Dug Song * * $Id: eth-snoop.c 548 2005-01-30 06:01:57Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "dnet.h" struct eth_handle { int fd; struct ifreq ifr; }; eth_t * eth_open(const char *device) { struct sockaddr_raw sr; eth_t *e; int n; if ((e = calloc(1, sizeof(*e))) == NULL) return (NULL); if ((e->fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_SNOOP)) < 0) return (eth_close(e)); memset(&sr, 0, sizeof(sr)); sr.sr_family = AF_RAW; strlcpy(sr.sr_ifname, device, sizeof(sr.sr_ifname)); if (bind(e->fd, (struct sockaddr *)&sr, sizeof(sr)) < 0) return (eth_close(e)); n = 60000; if (setsockopt(e->fd, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) < 0) return (eth_close(e)); strlcpy(e->ifr.ifr_name, device, sizeof(e->ifr.ifr_name)); return (e); } int eth_get(eth_t *e, eth_addr_t *ea) { struct addr ha; if (ioctl(e->fd, SIOCGIFADDR, &e->ifr) < 0) return (-1); if (addr_ston(&e->ifr.ifr_addr, &ha) < 0) return (-1); if (ha.addr_type != ADDR_TYPE_ETH) { errno = EINVAL; return (-1); } memcpy(ea, &ha.addr_eth, sizeof(*ea)); return (0); } int eth_set(eth_t *e, const eth_addr_t *ea) { struct addr ha; ha.addr_type = ADDR_TYPE_ETH; ha.addr_bits = ETH_ADDR_BITS; memcpy(&ha.addr_eth, ea, ETH_ADDR_LEN); if (addr_ntos(&ha, &e->ifr.ifr_addr) < 0) return (-1); return (ioctl(e->fd, SIOCSIFADDR, &e->ifr)); } ssize_t eth_send(eth_t *e, const void *buf, size_t len) { return (write(e->fd, buf, len)); } eth_t * eth_close(eth_t *e) { if (e != NULL) { if (e->fd >= 0) close(e->fd); free(e); } return (NULL); } libdnet-1.12/trunk/src/eth-win32.c0000644000076500007650000000521610315660441020050 0ustar dugsongdugsong00000000000000/* * eth-win32.c * * Copyright (c) 2000 Dug Song * * $Id: eth-win32.c 613 2005-09-26 02:46:57Z dugsong $ */ #include "config.h" /* XXX - VC++ 6.0 bogosity */ #define sockaddr_storage sockaddr #include #undef sockaddr_storage #include #include #include #include "dnet.h" struct eth_handle { LPADAPTER lpa; LPPACKET pkt; }; eth_t * eth_open(const char *device) { eth_t *eth; intf_t *intf; struct intf_entry ifent; eth_addr_t ea; char *p, *buf; ULONG len; /* Get interface entry. */ memset(&ifent, 0, sizeof(ifent)); if ((intf = intf_open()) != NULL) { strlcpy(ifent.intf_name, device, sizeof(ifent.intf_name)); intf_get(intf, &ifent); intf_close(intf); } if (ifent.intf_link_addr.addr_type != ADDR_TYPE_ETH) return (NULL); /* Get Packet driver adapter name/desc lists. */ buf = NULL; PacketGetAdapterNames(buf, &len); if (len > 0 && (buf = malloc(len)) != NULL) { if (!PacketGetAdapterNames(buf, &len)) { free(buf); buf = NULL; } } if (buf == NULL) return (NULL); /* XXX - find adapter with matching interface MAC address. */ if ((eth = calloc(1, sizeof(*eth))) == NULL) { free(buf); return (NULL); } for (p = buf; *p != '\0'; p += strlen(p) + 1) { if ((eth->lpa = PacketOpenAdapter(p)) != NULL) { if (eth->lpa->hFile != INVALID_HANDLE_VALUE && eth_get(eth, &ea) == 0 && memcmp(&ea, &ifent.intf_link_addr.addr_eth, ETH_ADDR_LEN) == 0) { PacketSetBuff(eth->lpa, 512000); eth->pkt = PacketAllocatePacket(); break; } PacketCloseAdapter(eth->lpa); } } free(buf); if (eth->pkt == NULL) eth = eth_close(eth); return (eth); } ssize_t eth_send(eth_t *eth, const void *buf, size_t len) { PacketInitPacket(eth->pkt, (void *)buf, len); PacketSendPacket(eth->lpa, eth->pkt, TRUE); return (len); } eth_t * eth_close(eth_t *eth) { if (eth != NULL) { if (eth->pkt != NULL) PacketFreePacket(eth->pkt); if (eth->lpa != NULL) PacketCloseAdapter(eth->lpa); free(eth); } return (NULL); } int eth_get(eth_t *eth, eth_addr_t *ea) { PACKET_OID_DATA *data; u_char buf[512]; data = (PACKET_OID_DATA *)buf; data->Oid = OID_802_3_CURRENT_ADDRESS; data->Length = ETH_ADDR_LEN; if (PacketRequest(eth->lpa, FALSE, data) == TRUE) { memcpy(ea, data->Data, ETH_ADDR_LEN); return (0); } return (-1); } int eth_set(eth_t *eth, const eth_addr_t *ea) { PACKET_OID_DATA *data; u_char buf[512]; data = (PACKET_OID_DATA *)buf; data->Oid = OID_802_3_CURRENT_ADDRESS; memcpy(data->Data, ea, ETH_ADDR_LEN); data->Length = ETH_ADDR_LEN; if (PacketRequest(eth->lpa, TRUE, data) == TRUE) return (0); return (-1); } libdnet-1.12/trunk/src/fw-ipchains.c0000644000076500007650000001316310046255700020537 0ustar dugsongdugsong00000000000000/* * fw-ipchains.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipchains.c 507 2004-05-05 21:25:20Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #undef __USE_BSD #include #include #ifdef HAVE_LINUX_IP_FW_H #include #elif defined(HAVE_LINUX_IP_FWCHAINS_H) #include #elif defined(HAVE_LINUX_NETFILTER_IPV4_IPCHAINS_CORE_H) #include #endif #include #include #include #include #include #include #include "dnet.h" #define PROC_IPCHAINS_FILE "/proc/net/ip_fwchains" struct fw_handle { int fd; }; static void fr_to_fwc(const struct fw_rule *fr, struct ip_fwchange *fwc) { memset(fwc, 0, sizeof(*fwc)); strlcpy(fwc->fwc_rule.ipfw.fw_vianame, fr->fw_device, IFNAMSIZ); if (fr->fw_op == FW_OP_ALLOW) strlcpy(fwc->fwc_rule.label, IP_FW_LABEL_ACCEPT, sizeof(fwc->fwc_rule.label)); else strlcpy(fwc->fwc_rule.label, IP_FW_LABEL_BLOCK, sizeof(fwc->fwc_rule.label)); if (fr->fw_dir == FW_DIR_IN) strlcpy(fwc->fwc_label, IP_FW_LABEL_INPUT, sizeof(fwc->fwc_label)); else strlcpy(fwc->fwc_label, IP_FW_LABEL_OUTPUT, sizeof(fwc->fwc_label)); fwc->fwc_rule.ipfw.fw_proto = fr->fw_proto; fwc->fwc_rule.ipfw.fw_src.s_addr = fr->fw_src.addr_ip; fwc->fwc_rule.ipfw.fw_dst.s_addr = fr->fw_dst.addr_ip; addr_btom(fr->fw_src.addr_bits, &fwc->fwc_rule.ipfw.fw_smsk.s_addr, IP_ADDR_LEN); addr_btom(fr->fw_dst.addr_bits, &fwc->fwc_rule.ipfw.fw_dmsk.s_addr, IP_ADDR_LEN); /* XXX - ICMP? */ fwc->fwc_rule.ipfw.fw_spts[0] = fr->fw_sport[0]; fwc->fwc_rule.ipfw.fw_spts[1] = fr->fw_sport[1]; fwc->fwc_rule.ipfw.fw_dpts[0] = fr->fw_dport[0]; fwc->fwc_rule.ipfw.fw_dpts[1] = fr->fw_dport[1]; } static void fwc_to_fr(const struct ip_fwchange *fwc, struct fw_rule *fr) { memset(fr, 0, sizeof(*fr)); strlcpy(fr->fw_device, fwc->fwc_rule.ipfw.fw_vianame, sizeof(fr->fw_device)); if (strcmp(fwc->fwc_rule.label, IP_FW_LABEL_ACCEPT) == 0) fr->fw_op = FW_OP_ALLOW; else fr->fw_op = FW_OP_BLOCK; if (strcmp(fwc->fwc_label, IP_FW_LABEL_INPUT) == 0) fr->fw_dir = FW_DIR_IN; else fr->fw_dir = FW_DIR_OUT; fr->fw_proto = fwc->fwc_rule.ipfw.fw_proto; fr->fw_src.addr_type = fr->fw_dst.addr_type = ADDR_TYPE_IP; fr->fw_src.addr_ip = fwc->fwc_rule.ipfw.fw_src.s_addr; fr->fw_dst.addr_ip = fwc->fwc_rule.ipfw.fw_dst.s_addr; addr_mtob(&fwc->fwc_rule.ipfw.fw_smsk.s_addr, IP_ADDR_LEN, &fr->fw_src.addr_bits); addr_mtob(&fwc->fwc_rule.ipfw.fw_dmsk.s_addr, IP_ADDR_LEN, &fr->fw_dst.addr_bits); /* XXX - ICMP? */ fr->fw_sport[0] = fwc->fwc_rule.ipfw.fw_spts[0]; fr->fw_sport[1] = fwc->fwc_rule.ipfw.fw_spts[1]; fr->fw_dport[0] = fwc->fwc_rule.ipfw.fw_dpts[0]; fr->fw_dport[1] = fwc->fwc_rule.ipfw.fw_dpts[1]; } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct ip_fwchange fwc; fr_to_fwc(rule, &fwc); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_APPEND, &fwc, sizeof(fwc))); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct ip_fwchange fwc; fr_to_fwc(rule, &fwc); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_DELETE, &fwc, sizeof(fwc))); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { FILE *fp; struct ip_fwchange fwc; struct fw_rule fr; char buf[BUFSIZ]; u_int phi, plo, bhi, blo, tand, txor; int ret; if ((fp = fopen(PROC_IPCHAINS_FILE, "r")) == NULL) return (-1); while (fgets(buf, sizeof(buf), fp) != NULL) { if (sscanf(buf, "%8s %X/%X->%X/%X %s %hX %hX %hu %u %u %u %u " "%hu-%hu %hu-%hu A%X X%X %hX %u %hu %s\n", fwc.fwc_label, &fwc.fwc_rule.ipfw.fw_src.s_addr, &fwc.fwc_rule.ipfw.fw_smsk.s_addr, &fwc.fwc_rule.ipfw.fw_dst.s_addr, &fwc.fwc_rule.ipfw.fw_dmsk.s_addr, fwc.fwc_rule.ipfw.fw_vianame, &fwc.fwc_rule.ipfw.fw_flg, &fwc.fwc_rule.ipfw.fw_invflg, &fwc.fwc_rule.ipfw.fw_proto, &phi, &plo, &bhi, &blo, &fwc.fwc_rule.ipfw.fw_spts[0], &fwc.fwc_rule.ipfw.fw_spts[1], &fwc.fwc_rule.ipfw.fw_dpts[0], &fwc.fwc_rule.ipfw.fw_dpts[1], &tand, &txor, &fwc.fwc_rule.ipfw.fw_redirpt, &fwc.fwc_rule.ipfw.fw_mark, &fwc.fwc_rule.ipfw.fw_outputsize, fwc.fwc_rule.label) != 23) break; if (strcmp(fwc.fwc_rule.label, IP_FW_LABEL_ACCEPT) != 0 && strcmp(fwc.fwc_rule.label, IP_FW_LABEL_BLOCK) != 0 && strcmp(fwc.fwc_rule.label, IP_FW_LABEL_REJECT) != 0) continue; if (strcmp(fwc.fwc_label, IP_FW_LABEL_INPUT) != 0 && strcmp(fwc.fwc_label, IP_FW_LABEL_OUTPUT) != 0) continue; if (strcmp(fwc.fwc_rule.label, "-") == 0) (fwc.fwc_rule.label)[0] = '\0'; if (strcmp(fwc.fwc_rule.ipfw.fw_vianame, "-") == 0) (fwc.fwc_rule.ipfw.fw_vianame)[0] = '\0'; fwc.fwc_rule.ipfw.fw_src.s_addr = htonl(fwc.fwc_rule.ipfw.fw_src.s_addr); fwc.fwc_rule.ipfw.fw_dst.s_addr = htonl(fwc.fwc_rule.ipfw.fw_dst.s_addr); fwc.fwc_rule.ipfw.fw_smsk.s_addr = htonl(fwc.fwc_rule.ipfw.fw_smsk.s_addr); fwc.fwc_rule.ipfw.fw_dmsk.s_addr = htonl(fwc.fwc_rule.ipfw.fw_dmsk.s_addr); fwc_to_fr(&fwc, &fr); if ((ret = callback(&fr, arg)) != 0) { fclose(fp); return (ret); } } fclose(fp); return (0); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/trunk/src/fw-ipf.c0000644000076500007650000001347210204737135017525 0ustar dugsongdugsong00000000000000 /* * fw-ipf.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipf.c 593 2005-02-16 21:42:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #define _NETINET_IP6_H_ /* XXX */ #include #define ip_t ipf_ip_t #ifdef HAVE_NETINET_IP_FIL_COMPAT_H # include #else # include #endif #include #undef ip_t #include #include #include #include #include #include #include #define KMEM_NAME "/dev/kmem" #include "dnet.h" #if !defined(fi_saddr) && !defined(fi_daddr) # define fi_saddr fi_src.s_addr # define fi_daddr fi_dst.s_addr #endif struct fw_handle { int fd; int kfd; }; static void rule_to_ipf(const struct fw_rule *rule, struct frentry *fr) { memset(fr, 0, sizeof(*fr)); if (*rule->fw_device != '\0') { strlcpy(fr->fr_ifname, rule->fw_device, IFNAMSIZ); strlcpy(fr->fr_oifname, rule->fw_device, IFNAMSIZ); } if (rule->fw_op == FW_OP_ALLOW) fr->fr_flags |= FR_PASS; else fr->fr_flags |= FR_BLOCK; if (rule->fw_dir == FW_DIR_IN) fr->fr_flags |= FR_INQUE; else fr->fr_flags |= FR_OUTQUE; fr->fr_ip.fi_p = rule->fw_proto; fr->fr_ip.fi_saddr = rule->fw_src.addr_ip; fr->fr_ip.fi_daddr = rule->fw_dst.addr_ip; addr_btom(rule->fw_src.addr_bits, &fr->fr_mip.fi_saddr, IP_ADDR_LEN); addr_btom(rule->fw_dst.addr_bits, &fr->fr_mip.fi_daddr, IP_ADDR_LEN); switch (rule->fw_proto) { case IPPROTO_ICMP: fr->fr_icmpm = rule->fw_sport[1] << 8 | (rule->fw_dport[1] & 0xff); fr->fr_icmp = rule->fw_sport[0] << 8 | (rule->fw_dport[0] & 0xff); break; case IPPROTO_TCP: case IPPROTO_UDP: fr->fr_sport = rule->fw_sport[0]; if (rule->fw_sport[0] != rule->fw_sport[1]) { fr->fr_scmp = FR_INRANGE; fr->fr_stop = rule->fw_sport[1]; } else fr->fr_scmp = FR_EQUAL; fr->fr_dport = rule->fw_dport[0]; if (rule->fw_dport[0] != rule->fw_dport[1]) { fr->fr_dcmp = FR_INRANGE; fr->fr_dtop = rule->fw_dport[1]; } else fr->fr_dcmp = FR_EQUAL; break; } } static void ipf_ports_to_rule(uint8_t cmp, uint16_t port, uint16_t top, uint16_t *range) { switch (cmp) { case FR_EQUAL: range[0] = range[1] = port; break; case FR_NEQUAL: range[0] = port - 1; range[1] = port + 1; break; case FR_LESST: range[0] = 0; range[1] = port - 1; break; case FR_GREATERT: range[0] = port + 1; range[1] = TCP_PORT_MAX; break; case FR_LESSTE: range[0] = 0; range[1] = port; break; case FR_GREATERTE: range[0] = port; range[1] = TCP_PORT_MAX; break; case FR_OUTRANGE: range[0] = port; range[1] = top; break; case FR_INRANGE: range[0] = port; range[1] = top; break; default: range[0] = 0; range[1] = TCP_PORT_MAX; } } static void ipf_to_rule(const struct frentry *fr, struct fw_rule *rule) { memset(rule, 0, sizeof(*rule)); strlcpy(rule->fw_device, fr->fr_ifname, sizeof(rule->fw_device)); rule->fw_op = (fr->fr_flags & FR_PASS) ? FW_OP_ALLOW : FW_OP_BLOCK; rule->fw_dir = (fr->fr_flags & FR_INQUE) ? FW_DIR_IN : FW_DIR_OUT; rule->fw_proto = fr->fr_ip.fi_p; rule->fw_src.addr_type = rule->fw_dst.addr_type = ADDR_TYPE_IP; rule->fw_src.addr_ip = fr->fr_ip.fi_saddr; rule->fw_dst.addr_ip = fr->fr_ip.fi_daddr; addr_mtob(&fr->fr_mip.fi_saddr, IP_ADDR_LEN, &rule->fw_src.addr_bits); addr_mtob(&fr->fr_mip.fi_daddr, IP_ADDR_LEN, &rule->fw_dst.addr_bits); switch (rule->fw_proto) { case IPPROTO_ICMP: rule->fw_sport[0] = ntohs(fr->fr_icmp & fr->fr_icmpm) >> 8; rule->fw_sport[1] = ntohs(fr->fr_icmpm) >> 8; rule->fw_dport[0] = ntohs(fr->fr_icmp & fr->fr_icmpm) & 0xff; rule->fw_dport[1] = ntohs(fr->fr_icmpm) & 0xff; break; case IPPROTO_TCP: case IPPROTO_UDP: ipf_ports_to_rule(fr->fr_scmp, fr->fr_sport, fr->fr_stop, rule->fw_sport); ipf_ports_to_rule(fr->fr_dcmp, fr->fr_dport, fr->fr_dtop, rule->fw_dport); break; } } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { fw->fd = fw->kfd = -1; if ((fw->fd = open(IPL_NAME, O_RDWR, 0)) < 0) return (fw_close(fw)); if ((fw->kfd = open(KMEM_NAME, O_RDONLY)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct frentry fr; assert(fw != NULL && rule != NULL); rule_to_ipf(rule, &fr); return (ioctl(fw->fd, SIOCADDFR, &fr)); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct frentry fr; assert(fw != NULL && rule != NULL); rule_to_ipf(rule, &fr); return (ioctl(fw->fd, SIOCDELFR, &fr)); } static int fw_kcopy(fw_t *fw, u_char *buf, off_t pos, size_t n) { int i; if (lseek(fw->kfd, pos, 0) < 0) return (-1); while ((i = read(fw->kfd, buf, n)) < n) { if (i <= 0) return (-1); buf += i; n -= i; } return (0); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct friostat fio; struct friostat *fiop = &fio; struct frentry *frp, fr; struct fw_rule rule; int ret; memset(&fio, 0, sizeof(fio)); #ifdef __OpenBSD__ if (ioctl(fw->fd, SIOCGETFS, fiop) < 0) #else if (ioctl(fw->fd, SIOCGETFS, &fiop) < 0) /* XXX - darren! */ #endif return (-1); for (frp = fio.f_fout[(int)fio.f_active]; frp != NULL; frp = fr.fr_next) { if (fw_kcopy(fw, (u_char *)&fr, (u_long)frp, sizeof(fr)) < 0) return (-1); ipf_to_rule(&fr, &rule); if ((ret = callback(&rule, arg)) != 0) return (ret); } for (frp = fio.f_fin[(int)fio.f_active]; frp != NULL; frp = fr.fr_next) { if (fw_kcopy(fw, (u_char *)&fr, (u_long)frp, sizeof(fr)) < 0) return (-1); ipf_to_rule(&fr, &rule); if ((ret = callback(&rule, arg)) != 0) return (ret); } return (0); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); if (fw->kfd >= 0) close(fw->kfd); free(fw); } return (NULL); } libdnet-1.12/trunk/src/fw-ipfw.c0000644000076500007650000001650010001145373017677 0ustar dugsongdugsong00000000000000/* * fw-ipfw.c * * Copyright (c) 2001 Dug Song * * $Id: fw-ipfw.c 483 2004-01-14 04:52:11Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct fw_handle { int fd; }; static void fr_to_ipfw_device(const char *device, char *name, short *unit) { char *p; p = strpbrk(device, "0123456789"); *unit = atoi(p); strlcpy(name, device, p - device + 1); } static void fr_to_ipfw(const struct fw_rule *fr, struct ip_fw *ipfw) { int i; memset(ipfw, 0, sizeof(*ipfw)); if (fr->fw_dir == FW_DIR_IN) { if (*fr->fw_device != '\0') { fr_to_ipfw_device(fr->fw_device, ipfw->fw_in_if.fu_via_if.name, &ipfw->fw_in_if.fu_via_if.unit); ipfw->fw_flg |= IP_FW_F_IIFNAME; } ipfw->fw_flg |= IP_FW_F_IN; } else { if (*fr->fw_device != '\0') { fr_to_ipfw_device(fr->fw_device, ipfw->fw_out_if.fu_via_if.name, &ipfw->fw_out_if.fu_via_if.unit); ipfw->fw_flg |= IP_FW_F_OIFNAME; } ipfw->fw_flg |= IP_FW_F_OUT; } if (fr->fw_op == FW_OP_ALLOW) ipfw->fw_flg |= IP_FW_F_ACCEPT; else ipfw->fw_flg |= IP_FW_F_DENY; ipfw->fw_prot = fr->fw_proto; ipfw->fw_src.s_addr = fr->fw_src.addr_ip; ipfw->fw_dst.s_addr = fr->fw_dst.addr_ip; addr_btom(fr->fw_src.addr_bits, &ipfw->fw_smsk.s_addr, IP_ADDR_LEN); addr_btom(fr->fw_dst.addr_bits, &ipfw->fw_dmsk.s_addr, IP_ADDR_LEN); switch (fr->fw_proto) { case IP_PROTO_TCP: case IP_PROTO_UDP: i = 0; if (fr->fw_sport[0] != fr->fw_sport[1]) { ipfw->fw_flg |= IP_FW_F_SRNG; ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[0]; ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[1]; IP_FW_SETNSRCP(ipfw, 2); } else if (fr->fw_sport[0] > 0) { ipfw->fw_uar.fw_pts[i++] = fr->fw_sport[0]; IP_FW_SETNSRCP(ipfw, 1); } if (fr->fw_dport[0] != fr->fw_dport[1]) { ipfw->fw_flg |= IP_FW_F_DRNG; ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[0]; ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[1]; IP_FW_SETNDSTP(ipfw, 2); } else if (fr->fw_dport[0] > 0) { ipfw->fw_uar.fw_pts[i++] = fr->fw_dport[0]; IP_FW_SETNDSTP(ipfw, 1); } break; case IP_PROTO_ICMP: if (fr->fw_sport[1]) { ipfw->fw_uar.fw_icmptypes[fr->fw_sport[0] / 32] |= 1 << (fr->fw_sport[0] % 32); ipfw->fw_flg |= IP_FW_F_ICMPBIT; } /* XXX - no support for ICMP code. */ break; } } static void ipfw_to_fr(const struct ip_fw *ipfw, struct fw_rule *fr) { int i; memset(fr, 0, sizeof(*fr)); if ((ipfw->fw_flg & IP_FW_F_IN) && *ipfw->fw_in_if.fu_via_if.name) snprintf(fr->fw_device, sizeof(fr->fw_device), "%s%d", ipfw->fw_in_if.fu_via_if.name, ipfw->fw_in_if.fu_via_if.unit); else if ((ipfw->fw_flg & IP_FW_F_OUT) && *ipfw->fw_out_if.fu_via_if.name) snprintf(fr->fw_device, sizeof(fr->fw_device), "%s%d", ipfw->fw_out_if.fu_via_if.name, ipfw->fw_out_if.fu_via_if.unit); fr->fw_op = (ipfw->fw_flg & IP_FW_F_ACCEPT) ? FW_OP_ALLOW : FW_OP_BLOCK; fr->fw_dir = (ipfw->fw_flg & IP_FW_F_IN) ? FW_DIR_IN : FW_DIR_OUT; fr->fw_proto = ipfw->fw_prot; fr->fw_src.addr_type = fr->fw_dst.addr_type = ADDR_TYPE_IP; fr->fw_src.addr_ip = ipfw->fw_src.s_addr; fr->fw_dst.addr_ip = ipfw->fw_dst.s_addr; addr_mtob(&ipfw->fw_smsk.s_addr, IP_ADDR_LEN, &fr->fw_src.addr_bits); addr_mtob(&ipfw->fw_dmsk.s_addr, IP_ADDR_LEN, &fr->fw_dst.addr_bits); switch (fr->fw_proto) { case IP_PROTO_TCP: case IP_PROTO_UDP: if ((ipfw->fw_flg & IP_FW_F_SRNG) && IP_FW_GETNSRCP(ipfw) == 2) { fr->fw_sport[0] = ipfw->fw_uar.fw_pts[0]; fr->fw_sport[1] = ipfw->fw_uar.fw_pts[1]; } else if (IP_FW_GETNSRCP(ipfw) == 1) { fr->fw_sport[0] = fr->fw_sport[1] = ipfw->fw_uar.fw_pts[0]; } else if (IP_FW_GETNSRCP(ipfw) == 0) { fr->fw_sport[0] = 0; fr->fw_sport[1] = TCP_PORT_MAX; } if ((ipfw->fw_flg & IP_FW_F_DRNG) && IP_FW_GETNDSTP(ipfw) == 2) { i = IP_FW_GETNSRCP(ipfw); fr->fw_dport[0] = ipfw->fw_uar.fw_pts[i]; fr->fw_dport[1] = ipfw->fw_uar.fw_pts[i + 1]; } else if (IP_FW_GETNDSTP(ipfw) == 1) { i = IP_FW_GETNSRCP(ipfw); fr->fw_dport[0] = fr->fw_dport[1] = ipfw->fw_uar.fw_pts[i]; } else if (IP_FW_GETNDSTP(ipfw) == 0) { fr->fw_dport[0] = 0; fr->fw_dport[1] = TCP_PORT_MAX; } break; case IP_PROTO_ICMP: if (ipfw->fw_flg & IP_FW_F_ICMPBIT) { for (i = 0; i < IP_FW_ICMPTYPES_DIM * 32; i++) { if (ipfw->fw_uar.fw_icmptypes[i / 32] & (1U << (i % 32))) { fr->fw_sport[0] = i; fr->fw_sport[1] = 0xff; break; } } } /* XXX - no support for ICMP code. */ break; } } fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = socket(AF_INET, SOCK_RAW, IPPROTO_IP)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct ip_fw ipfw; assert(fw != NULL && rule != NULL); fr_to_ipfw(rule, &ipfw); return (setsockopt(fw->fd, IPPROTO_IP, IP_FW_ADD, &ipfw, sizeof(ipfw))); } static int fw_cmp(const struct fw_rule *a, const struct fw_rule *b) { if (strcmp(a->fw_device, b->fw_device) != 0 || a->fw_op != b->fw_op || a->fw_dir != b->fw_dir || a->fw_proto != b->fw_proto || addr_cmp(&a->fw_src, &b->fw_src) != 0 || addr_cmp(&a->fw_dst, &b->fw_dst) != 0 || memcmp(a->fw_sport, b->fw_sport, sizeof(a->fw_sport)) != 0 || memcmp(a->fw_dport, b->fw_dport, sizeof(a->fw_dport)) != 0) return (-1); return (0); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct ip_fw *ipfw; struct fw_rule fr; int nbytes, nalloc, ret; u_char *buf, *new; assert(rule != NULL); nbytes = nalloc = sizeof(*ipfw); if ((buf = malloc(nbytes)) == NULL) return (-1); while (nbytes >= nalloc) { nalloc = nalloc * 2 + 200; nbytes = nalloc; if ((new = realloc(buf, nbytes)) == NULL) { if (buf) free(buf); return (-1); } buf = new; if (getsockopt(fw->fd, IPPROTO_IP, IP_FW_GET, buf, &nbytes) < 0) { free(buf); return (-1); } } ret = -1; /* XXX - 65535 is the fixed ipfw default rule. */ for (ipfw = (struct ip_fw *)buf; ipfw->fw_number < 65535; ipfw++) { ipfw_to_fr(ipfw, &fr); if (fw_cmp(&fr, rule) == 0) { if (setsockopt(fw->fd, IPPROTO_IP, IP_FW_DEL, ipfw, sizeof(*ipfw)) < 0) ret = -2; else ret = 0; break; } } free(buf); if (ret < 0) { if (ret == -1) errno = ESRCH; return (-1); } return (0); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct ip_fw *ipfw; struct fw_rule fr; int i, cnt, nbytes, nalloc, ret; u_char *buf, *new; nbytes = nalloc = sizeof(*ipfw); if ((buf = malloc(nbytes)) == NULL) return (-1); while (nbytes >= nalloc) { nalloc = nalloc * 2 + 200; nbytes = nalloc; if ((new = realloc(buf, nbytes)) == NULL) { if (buf) free(buf); return (-1); } buf = new; if (getsockopt(fw->fd, IPPROTO_IP, IP_FW_GET, buf, &nbytes) < 0) { free(buf); return (-1); } } cnt = nbytes / sizeof(*ipfw); ipfw = (struct ip_fw *)buf; ret = 0; for (i = 0; i < cnt; i++) { ipfw_to_fr(&ipfw[i], &fr); if ((ret = callback(&fr, arg)) != 0) break; } free(buf); return (ret); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/trunk/src/fw-none.c0000644000076500007650000000112407422632520017675 0ustar dugsongdugsong00000000000000/* * fw-none.c * * Copyright (c) 2000 Dug Song * * $Id: fw-none.c 208 2002-01-20 21:23:28Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" fw_t * fw_open(void) { errno = ENOSYS; return (NULL); } int fw_add(fw_t *f, const struct fw_rule *rule) { errno = ENOSYS; return (-1); } int fw_delete(fw_t *f, const struct fw_rule *rule) { errno = ENOSYS; return (-1); } int fw_loop(fw_t *f, fw_handler callback, void *arg) { errno = ENOSYS; return (-1); } fw_t * fw_close(fw_t *f) { return (NULL); } libdnet-1.12/trunk/src/fw-pf.c0000644000076500007650000001657710215466441017366 0ustar dugsongdugsong00000000000000/* * fw-pf.c * * Copyright (c) 2001 Dug Song * * $Id: fw-pf.c 608 2005-03-15 05:05:37Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" /* * XXX - cope with moving pf API */ #if defined(DIOCRCLRTABLES) /* XXX - can't isolate the following change: * $OpenBSD: pfvar.h,v 1.112 2002/12/17 12:30:13 mcbride Exp $ * so i'll take 1.119's DIOCRCLRTABLES - 12 days of pf unsupported. */ # define HAVE_PF_CHANGE_GET_TICKET 1 /* OpenBSD 3.3+ - 3.6 */ /* $OpenBSD: pfvar.h,v 1.197 2004/06/14 20:53:27 cedric Exp $ */ /* $OpenBSD: pfvar.h,v 1.130 2003/01/09 10:40:45 cedric Exp $ */ /* $OpenBSD: pfvar.h,v 1.127 2003/01/05 22:14:23 dhartmei Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.v.a.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->addr.v.a.mask.v4.s_addr # define pfioc_changerule pfioc_rule # define oldrule rule # define newrule rule #elif defined(DIOCBEGINADDRS) /* $OpenBSD: pfvar.h,v 1.102 2002/11/23 05:16:58 mcbride Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->addr.mask.v4.s_addr #elif defined(PFRULE_FRAGMENT) /* OpenBSD 3.2 */ /* $OpenBSD: pfvar.h,v 1.68 2002/04/24 18:10:25 dhartmei Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.addr.v4.s_addr # define PFRA_MASK(ra) (ra)->mask.v4.s_addr #elif defined (PF_AEQ) /* OpenBSD 3.1 */ /* $OpenBSD: pfvar.h,v 1.51 2001/09/15 03:54:40 frantzen Exp $ */ # define PFRA_ADDR(ra) (ra)->addr.v4.s_addr # define PFRA_MASK(ra) (ra)->mask.v4.s_addr #else /* OpenBSD 3.0 */ # define PFRA_ADDR(ra) (ra)->addr # define PFRA_ADDR(ra) (ra)->mask #endif struct fw_handle { int fd; }; static void fr_to_pr(const struct fw_rule *fr, struct pf_rule *pr) { memset(pr, 0, sizeof(*pr)); strlcpy(pr->ifname, fr->fw_device, sizeof(pr->ifname)); pr->action = (fr->fw_op == FW_OP_ALLOW) ? PF_PASS : PF_DROP; pr->direction = (fr->fw_dir == FW_DIR_IN) ? PF_IN : PF_OUT; pr->proto = fr->fw_proto; pr->af = AF_INET; PFRA_ADDR(&pr->src) = fr->fw_src.addr_ip; addr_btom(fr->fw_src.addr_bits, &(PFRA_MASK(&pr->src)), IP_ADDR_LEN); PFRA_ADDR(&pr->dst) = fr->fw_dst.addr_ip; addr_btom(fr->fw_dst.addr_bits, &(PFRA_MASK(&pr->dst)), IP_ADDR_LEN); switch (fr->fw_proto) { case IP_PROTO_ICMP: if (fr->fw_sport[1]) pr->type = (u_char)(fr->fw_sport[0] & fr->fw_sport[1]) + 1; if (fr->fw_dport[1]) pr->code = (u_char)(fr->fw_dport[0] & fr->fw_dport[1]) + 1; break; case IP_PROTO_TCP: case IP_PROTO_UDP: pr->src.port[0] = htons(fr->fw_sport[0]); pr->src.port[1] = htons(fr->fw_sport[1]); if (pr->src.port[0] == pr->src.port[1]) { pr->src.port_op = PF_OP_EQ; } else pr->src.port_op = PF_OP_IRG; pr->dst.port[0] = htons(fr->fw_dport[0]); pr->dst.port[1] = htons(fr->fw_dport[1]); if (pr->dst.port[0] == pr->dst.port[1]) { pr->dst.port_op = PF_OP_EQ; } else pr->dst.port_op = PF_OP_IRG; break; } } static int pr_to_fr(const struct pf_rule *pr, struct fw_rule *fr) { memset(fr, 0, sizeof(*fr)); strlcpy(fr->fw_device, pr->ifname, sizeof(fr->fw_device)); if (pr->action == PF_DROP) fr->fw_op = FW_OP_BLOCK; else if (pr->action == PF_PASS) fr->fw_op = FW_OP_ALLOW; else return (-1); fr->fw_dir = pr->direction == PF_IN ? FW_DIR_IN : FW_DIR_OUT; fr->fw_proto = pr->proto; if (pr->af != AF_INET) return (-1); fr->fw_src.addr_type = ADDR_TYPE_IP; addr_mtob(&(PFRA_MASK(&pr->src)), IP_ADDR_LEN, &fr->fw_src.addr_bits); fr->fw_src.addr_ip = PFRA_ADDR(&pr->src); fr->fw_dst.addr_type = ADDR_TYPE_IP; addr_mtob(&(PFRA_MASK(&pr->dst)), IP_ADDR_LEN, &fr->fw_dst.addr_bits); fr->fw_dst.addr_ip = PFRA_ADDR(&pr->dst); switch (fr->fw_proto) { case IP_PROTO_ICMP: if (pr->type) { fr->fw_sport[0] = pr->type - 1; fr->fw_sport[1] = 0xff; } if (pr->code) { fr->fw_dport[0] = pr->code - 1; fr->fw_dport[1] = 0xff; } break; case IP_PROTO_TCP: case IP_PROTO_UDP: fr->fw_sport[0] = ntohs(pr->src.port[0]); fr->fw_sport[1] = ntohs(pr->src.port[1]); if (pr->src.port_op == PF_OP_EQ) fr->fw_sport[1] = fr->fw_sport[0]; fr->fw_dport[0] = ntohs(pr->dst.port[0]); fr->fw_dport[1] = ntohs(pr->dst.port[1]); if (pr->dst.port_op == PF_OP_EQ) fr->fw_dport[1] = fr->fw_dport[0]; } return (0); } #ifdef HAVE_PF_CHANGE_GET_TICKET static int _fw_cmp(const struct fw_rule *a, const struct fw_rule *b) { if (strcmp(a->fw_device, b->fw_device) != 0 || a->fw_op != b->fw_op || a->fw_dir != b->fw_dir || a->fw_proto != b->fw_proto || addr_cmp(&a->fw_src, &b->fw_src) != 0 || addr_cmp(&a->fw_dst, &b->fw_dst) != 0 || memcmp(a->fw_sport, b->fw_sport, sizeof(a->fw_sport)) != 0 || memcmp(a->fw_dport, b->fw_dport, sizeof(a->fw_dport)) != 0) return (-1); return (0); } #endif fw_t * fw_open(void) { fw_t *fw; if ((fw = calloc(1, sizeof(*fw))) != NULL) { if ((fw->fd = open("/dev/pf", O_RDWR)) < 0) return (fw_close(fw)); } return (fw); } int fw_add(fw_t *fw, const struct fw_rule *rule) { struct pfioc_changerule pcr; assert(fw != NULL && rule != NULL); memset(&pcr, 0, sizeof(pcr)); #ifdef HAVE_PF_CHANGE_GET_TICKET { struct fw_rule fr; if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) return (-1); while ((int)--pcr.nr >= 0) { if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && pr_to_fr(&pcr.rule, &fr) == 0) { if (_fw_cmp(rule, &fr) == 0) { errno = EEXIST; return (-1); } } } } #endif #ifdef DIOCBEGINADDRS { struct pfioc_pooladdr ppa; if (ioctl(fw->fd, DIOCBEGINADDRS, &ppa) < 0) return (-1); pcr.pool_ticket = ppa.ticket; } #endif pcr.action = PF_CHANGE_ADD_TAIL; fr_to_pr(rule, &pcr.newrule); return (ioctl(fw->fd, DIOCCHANGERULE, &pcr)); } int fw_delete(fw_t *fw, const struct fw_rule *rule) { struct pfioc_changerule pcr; assert(fw != NULL && rule != NULL); memset(&pcr, 0, sizeof(pcr)); #ifdef HAVE_PF_CHANGE_GET_TICKET { struct fw_rule fr; int found = 0; if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) return (-1); while ((int)--pcr.nr >= 0) { if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && pr_to_fr(&pcr.rule, &fr) == 0) { if (_fw_cmp(rule, &fr) == 0) { found = 1; break; } } } if (!found) { errno = ENOENT; return (-1); } } #endif #ifdef DIOCBEGINADDRS { struct pfioc_pooladdr ppa; if (ioctl(fw->fd, DIOCBEGINADDRS, &ppa) < 0) return (-1); pcr.pool_ticket = ppa.ticket; } #endif pcr.action = PF_CHANGE_REMOVE; fr_to_pr(rule, &pcr.oldrule); return (ioctl(fw->fd, DIOCCHANGERULE, &pcr)); } int fw_loop(fw_t *fw, fw_handler callback, void *arg) { struct pfioc_rule pr; struct fw_rule fr; uint32_t n, max; int ret = 0; memset(&pr, 0, sizeof(pr)); if (ioctl(fw->fd, DIOCGETRULES, &pr) < 0) return (-1); for (n = 0, max = pr.nr; n < max; n++) { pr.nr = n; if ((ret = ioctl(fw->fd, DIOCGETRULE, &pr)) < 0) break; #ifdef PF_TABLE_NAME_SIZE /* XXX - actually in r1.125, not 1.126 */ if (pr.rule.src.addr.type == PF_ADDR_TABLE || pr.rule.dst.addr.type == PF_ADDR_TABLE) continue; #endif if (pr_to_fr(&pr.rule, &fr) < 0) continue; if ((ret = callback(&fr, arg)) != 0) break; } return (ret); } fw_t * fw_close(fw_t *fw) { if (fw != NULL) { if (fw->fd >= 0) close(fw->fd); free(fw); } return (NULL); } libdnet-1.12/trunk/src/fw-pktfilter.c0000644000076500007650000002456010204314223020740 0ustar dugsongdugsong00000000000000/* * fw-pktfilter.c * * Copyright (c) 2002 Dug Song * Copyright (c) 2001 Jean-Baptiste Marchand, Hervé Schauer Consultants. * * $Id: fw-pktfilter.c 587 2005-02-15 06:37:07Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #define PKTFILTER_PIPE "\\\\.\\pipe\\PktFltPipe" #define MAX_RULE_LENGTH 256 #define FILTER_FAILURE 0 /* filter had a syntax error */ #define FILTER_SUCCESS 1 /* filter was correctly added */ #define FILTER_MESSAGE 2 /* informative message returned to the client */ char *icmp_types[] = { "echorep", /* 0: echo reply */ "", /* 1: unused */ "", /* 2: unused */ "unreach", /* 3: destination unreachable */ "squench", /* 4: source quench */ "redir", /* 5: redirect */ "", /* 6: unused */ "", /* 7: unused */ "echo", /* 8: echo request */ "router_adv", /* 9: router advertisement */ "router_sol", /* 10: router solicitation */ "timex", /* 11: time exceeded */ "paramprob", /* 12: parameter problem */ "timest", /* 13: timestamp request */ "timestrep", /* 14: timestamp reply */ "inforeq", /* 15: information request */ "inforep", /* 16: information reply */ "maskreq", /* 17: address mask request */ "maskrep", /* 18: address mask reply */ NULL }; struct fw_handle { IP_ADAPTER_INFO *ifinfo; /* XXX - rules cache for delete lookup? */ }; static int parse_addr(char *p, struct addr *a) { if (strcmp(p, "any") == 0) return (addr_aton("0.0.0.0/0", a)); return (addr_aton(p, a)); } static int parse_portspec(char *str, uint16_t *ports) { char *p = strsep(&str, " "); if (p[0] == '=') { ports[0] = ports[1] = atoi(strsep(&str, " ")); } else if (p[0] == '<') { ports[1] = atoi(strsep(&str, " ")); if (p[1] != '=') ports[1]--; } else if (p[0] == '>') { ports[1] = TCP_PORT_MAX; ports[0] = atoi(strsep(&str, " ")); if (p[1] != '=') ports[0]++; } else if (p[0] != '\0') { if (strcmp(strsep(&str, " "), "><") != 0) return (-1); ports[0] = atoi(p) + 1; ports[1] = atoi(strsep(&str, " ")) - 1; } return (0); } static int parse_icmpspec(char *str, uint16_t *type, uint16_t *code) { char *p, *e; int i; p = strsep(&str, " "); for (i = 0; icmp_types[i] && strcmp(p, icmp_types[i]); i++) ; if (icmp_types[i] == NULL) { i = strtol(p, &e, 10); if (*e != '\0') return (-1); } type[0] = i; type[1] = 0xff; p = strsep(&str, " "); if (p != NULL && strcmp(p, "code")) { p = strsep(&str, " "); i = strtol(p, &e, 10); if (*e != '\0') return (-1); code[0] = i; code[1] = 0xff; } return (0); } /* on all on proto all on proto from [ports] to [ports] on proto icmp all [icmp-type [code ]] on proto icmp from to [icmp-type [code ]] */ static int parse_rule(char *str, struct fw_rule *rule) { char *p, *q; memset(rule, 0, sizeof(*rule)); /* action */ p = strsep(&str, " "); if (strcmp(p, "block") == 0) rule->fw_op = FW_OP_BLOCK; else if (strcmp(p, "pass") == 0) rule->fw_op = FW_OP_ALLOW; else return (-1); /* direction */ p = strsep(&str, " "); if (strcmp(p, "in") == 0) rule->fw_dir = FW_DIR_IN; else if (strcmp(p, "out") == 0) rule->fw_dir = FW_DIR_OUT; else return (-1); /* device */ if (strcmp(strsep(&str, " "), "on") != 0) return (-1); p = strsep(&str, " "); /* XXX - handle bug in pktfltsrv.c */ if ((q = strstr(p, "proto")) != NULL) *q = '\0'; if (strcmp(p, "all") != 0) strlcpy(rule->fw_device, p, sizeof(rule->fw_device)); /* proto */ p = strsep(&str, " "); /* XXX - handle bug in pktfltsrv.c */ if (strcmp(p, "proto") == 0) p = strsep(&str, " "); /* XXX - handle default rules */ if (strcmp(p, "all") == 0) return (0); if (strcmp(p, "icmp") == 0) rule->fw_proto = IP_PROTO_ICMP; else if (strcmp(p, "tcp") == 0) rule->fw_proto = IP_PROTO_TCP; else if (strcmp(p, "udp") == 0) rule->fw_proto = IP_PROTO_UDP; else rule->fw_proto = atoi(p); /* source */ p = strsep(&str, " "); if (strcmp(p, "all") == 0) return (0); if (strcmp(p, "from") != 0) goto icmp_type_code; p = strsep(&str, " "); if (parse_addr(p, &rule->fw_src) < 0) return (-1); /* source port */ p = strsep(&str, " "); if (strcmp(p, "port") == 0) { if ((p = strstr(str, " to ")) == NULL) return (-1); *p++ = '\0'; if (parse_portspec(str, rule->fw_sport) < 0) return (-1); str = p + 3; } else if (strcmp(p, "to") != 0) return (-1); /* destination */ p = strsep(&str, " "); if (parse_addr(p, &rule->fw_dst) < 0) return (-1); /* destination port */ p = strsep(&str, " "); if (strcmp(p, "port") == 0) return (parse_portspec(str, rule->fw_dport)); icmp_type_code: /* icmp-type, code */ if (strcmp(p, "icmp-type") == 0) { if (parse_icmpspec(str, rule->fw_sport, rule->fw_dport) < 0) return (-1); } return (0); } static int format_rule(const struct fw_rule *rule, char *buf, int len) { char tmp[128]; strlcpy(buf, (rule->fw_op == FW_OP_ALLOW) ? "pass " : "block ", len); strlcat(buf, (rule->fw_dir == FW_DIR_IN) ? "in " : "out ", len); snprintf(tmp, sizeof(tmp), "on %s ", rule->fw_device); strlcat(buf, tmp, len); if (rule->fw_proto != 0) { snprintf(tmp, sizeof(tmp), "proto %d ", rule->fw_proto); strlcat(buf, tmp, len); } /* source */ if (rule->fw_src.addr_type != ADDR_TYPE_NONE) { snprintf(tmp, sizeof(tmp), "from %s ", addr_ntoa(&rule->fw_src)); strlcat(buf, tmp, len); } else strlcat(buf, "from any ", len); /* sport */ if (rule->fw_proto == IP_PROTO_TCP || rule->fw_proto == IP_PROTO_UDP) { if (rule->fw_sport[0] == rule->fw_sport[1]) snprintf(tmp, sizeof(tmp), "port = %d ", rule->fw_sport[0]); else snprintf(tmp, sizeof(tmp), "port %d >< %d ", rule->fw_sport[0] - 1, rule->fw_sport[1] + 1); strlcat(buf, tmp, len); } /* destination */ if (rule->fw_dst.addr_type != ADDR_TYPE_NONE) { snprintf(tmp, sizeof(tmp), "to %s ", addr_ntoa(&rule->fw_dst)); strlcat(buf, tmp, len); } else strlcat(buf, "to any ", len); /* dport */ if (rule->fw_proto == IP_PROTO_TCP || rule->fw_proto == IP_PROTO_UDP) { if (rule->fw_dport[0] == rule->fw_dport[1]) snprintf(tmp, sizeof(tmp), "port = %d", rule->fw_dport[0]); else snprintf(tmp, sizeof(tmp), "port %d >< %d", rule->fw_dport[0] - 1, rule->fw_dport[1] + 1); strlcat(buf, tmp, len); } else if (rule->fw_proto == IP_PROTO_ICMP) { if (rule->fw_sport[1]) { snprintf(tmp, sizeof(tmp), "icmp-type %d", rule->fw_sport[0]); strlcat(buf, tmp, len); if (rule->fw_dport[1]) { snprintf(tmp, sizeof(tmp), " code %d", rule->fw_dport[0]); strlcat(buf, tmp, len); } } } return (strlen(buf)); } static char * call_pipe(const char *msg, int len) { HANDLE *pipe; DWORD i; char *p, *reply, status; if (!WaitNamedPipe(PKTFILTER_PIPE, NMPWAIT_USE_DEFAULT_WAIT) || (pipe = CreateFile(PKTFILTER_PIPE, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) { return (NULL); } reply = NULL; if (WriteFile(pipe, msg, len, &i, NULL)) { if (ReadFile(pipe, &status, sizeof(status), &i, NULL)) { if (status == FILTER_FAILURE) { ReadFile(pipe, &status, sizeof(status), &i, NULL); } else if (status == FILTER_MESSAGE) { /* get msg length */ if (ReadFile(pipe, &len, 4, &i, NULL)) { /* get msg */ p = reply = calloc(1, len + 1); if (!ReadFile(pipe, reply, len, &i, NULL)) { free(reply); reply = NULL; } } } else if (status == FILTER_SUCCESS) reply = strdup(""); /* XXX */ } } CloseHandle(pipe); return (reply); } fw_t * fw_open(void) { fw_t *f; IP_ADAPTER_INFO *ifinfo; ULONG size; if ((f = calloc(1, sizeof(*f))) == NULL) return (NULL); size = sizeof(*f->ifinfo); f->ifinfo = malloc(size); if (GetAdaptersInfo(f->ifinfo, &size) != ERROR_SUCCESS) { free(f->ifinfo); f->ifinfo = malloc(size); GetAdaptersInfo(f->ifinfo, &size); } /* XXX - normalize interface names. */ for (ifinfo = f->ifinfo; ifinfo != NULL; ifinfo = ifinfo->Next) { char *fmt; if (ifinfo->Type == MIB_IF_TYPE_ETHERNET) fmt = "eth"; else if (ifinfo->Type == MIB_IF_TYPE_PPP) fmt = "ppp"; else if (ifinfo->Type == MIB_IF_TYPE_SLIP) fmt = "sl"; else if (ifinfo->Type == MIB_IF_TYPE_LOOPBACK) fmt = "lo"; else if (ifinfo->Type == MIB_IF_TYPE_TOKENRING) fmt = "tr"; else if (ifinfo->Type == MIB_IF_TYPE_FDDI) fmt = "fd"; else fmt = "if"; sprintf(ifinfo->AdapterName, "%s%lu", fmt, ifinfo->ComboIndex); } return (f); } int fw_add(fw_t *f, const struct fw_rule *rule) { char *p, buf[MAX_RULE_LENGTH]; int len; len = format_rule(rule, buf, sizeof(buf)); if ((p = call_pipe(buf, len)) == NULL) return (-1); free(p); return (0); } int fw_delete(fw_t *f, const struct fw_rule *rule) { struct fw_rule tmp; char *p, *line, *msg, cmd[128], buf[MAX_RULE_LENGTH]; int n, ruleno, len; format_rule(rule, buf, sizeof(buf)); len = snprintf(cmd, sizeof(cmd), "List on %s", rule->fw_device); if ((msg = call_pipe(cmd, len)) == NULL) return (-1); for (ruleno = 0, p = msg; (line = strsep(&p, "\r\n")) != NULL; ) { if (strncmp(line, "rule ", 5) == 0) { line += 5; n = atoi(strsep(&line, ":")); if (parse_rule(line + 1, &tmp) == 0 && memcmp(&tmp, rule, sizeof(tmp)) == 0) { ruleno = n; break; } } } free(msg); if (ruleno == 0) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } len = snprintf(cmd, sizeof(cmd), "delete %d on %s", ruleno, rule->fw_device); if ((p = call_pipe(cmd, len)) == NULL) return (-1); free(p); return (0); } int fw_loop(fw_t *f, fw_handler callback, void *arg) { struct fw_rule rule; IP_ADAPTER_INFO *ifinfo; char *p, *line, *msg, buf[MAX_RULE_LENGTH]; int len, ret; for (ret = 0, ifinfo = f->ifinfo; ret == 0 && ifinfo != NULL; ifinfo = ifinfo->Next) { len = snprintf(buf, sizeof(buf), "list on %s", ifinfo->AdapterName); if ((msg = call_pipe(buf, len)) == NULL) return (-1); /* parse msg */ for (p = msg; (line = strsep(&p, "\r\n")) != NULL; ) { if (*line == '\0' || *line == '#' || isspace(*line)) continue; if (parse_rule(line, &rule) == 0) { if ((ret = callback(&rule, arg)) != 0) break; } } free(msg); } return (ret); } fw_t * fw_close(fw_t *f) { if (f != NULL) { free(f->ifinfo); free(f); } return (NULL); } libdnet-1.12/trunk/src/intf-win32.c0000644000076500007650000001766110466533744020253 0ustar dugsongdugsong00000000000000/* * intf-win32.c * * Copyright (c) 2002 Dug Song * * $Id: intf-win32.c 632 2006-08-10 04:36:52Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" struct ifcombo { DWORD *idx; int cnt; int max; }; /* XXX - ipifcons.h incomplete, use IANA ifTypes MIB */ #define MIB_IF_TYPE_TUNNEL 131 #define MIB_IF_TYPE_MAX 255 struct intf_handle { struct ifcombo ifcombo[MIB_IF_TYPE_MAX]; MIB_IFTABLE *iftable; MIB_IPADDRTABLE *iptable; }; static char * _ifcombo_name(int type) { char *name = "eth"; /* XXX */ if (type == MIB_IF_TYPE_TOKENRING) { name = "tr"; } else if (type == MIB_IF_TYPE_FDDI) { name = "fddi"; } else if (type == MIB_IF_TYPE_PPP) { name = "ppp"; } else if (type == MIB_IF_TYPE_LOOPBACK) { name = "lo"; } else if (type == MIB_IF_TYPE_SLIP) { name = "sl"; } else if (type == MIB_IF_TYPE_TUNNEL) { name = "tun"; } return (name); } static int _ifcombo_type(const char *device) { int type = INTF_TYPE_OTHER; if (strncmp(device, "eth", 3) == 0) { type = INTF_TYPE_ETH; } else if (strncmp(device, "tr", 2) == 0) { type = INTF_TYPE_TOKENRING; } else if (strncmp(device, "fd", 2) == 0) { type = INTF_TYPE_FDDI; } else if (strncmp(device, "ppp", 3) == 0) { type = INTF_TYPE_PPP; } else if (strncmp(device, "lo", 2) == 0) { type = INTF_TYPE_LOOPBACK; } else if (strncmp(device, "sl", 2) == 0) { type = INTF_TYPE_SLIP; } else if (strncmp(device, "tun", 3) == 0) { type = INTF_TYPE_TUN; } return (type); } static void _ifcombo_add(struct ifcombo *ifc, DWORD idx) { if (ifc->cnt == ifc->max) { if (ifc->idx) { ifc->max *= 2; ifc->idx = realloc(ifc->idx, sizeof(ifc->idx[0]) * ifc->max); } else { ifc->max = 8; ifc->idx = malloc(sizeof(ifc->idx[0]) * ifc->max); } } ifc->idx[ifc->cnt++] = idx; } static void _ifrow_to_entry(intf_t *intf, MIB_IFROW *ifrow, struct intf_entry *entry) { struct addr *ap, *lap; int i; memset(entry, 0, sizeof(*entry)); for (i = 0; i < intf->ifcombo[ifrow->dwType].cnt; i++) { if (intf->ifcombo[ifrow->dwType].idx[i] == ifrow->dwIndex) break; } /* XXX - dwType matches MIB-II ifType. */ snprintf(entry->intf_name, sizeof(entry->intf_name), "%s%lu", _ifcombo_name(ifrow->dwType), i); entry->intf_type = (uint16_t)ifrow->dwType; /* Get interface flags. */ entry->intf_flags = 0; if (ifrow->dwAdminStatus == MIB_IF_ADMIN_STATUS_UP && (ifrow->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL || ifrow->dwOperStatus == MIB_IF_OPER_STATUS_CONNECTED)) entry->intf_flags |= INTF_FLAG_UP; if (ifrow->dwType == MIB_IF_TYPE_LOOPBACK) entry->intf_flags |= INTF_FLAG_LOOPBACK; else entry->intf_flags |= INTF_FLAG_MULTICAST; /* Get interface MTU. */ entry->intf_mtu = ifrow->dwMtu; /* Get hardware address. */ if (ifrow->dwPhysAddrLen == ETH_ADDR_LEN) { entry->intf_link_addr.addr_type = ADDR_TYPE_ETH; entry->intf_link_addr.addr_bits = ETH_ADDR_BITS; memcpy(&entry->intf_link_addr.addr_eth, ifrow->bPhysAddr, ETH_ADDR_LEN); } /* Get addresses. */ ap = entry->intf_alias_addrs; lap = ap + ((entry->intf_len - sizeof(*entry)) / sizeof(entry->intf_alias_addrs[0])); for (i = 0; i < (int)intf->iptable->dwNumEntries; i++) { if (intf->iptable->table[i].dwIndex == ifrow->dwIndex && intf->iptable->table[i].dwAddr != 0) { if (entry->intf_addr.addr_type == ADDR_TYPE_NONE) { /* Set primary address if unset. */ entry->intf_addr.addr_type = ADDR_TYPE_IP; entry->intf_addr.addr_ip = intf->iptable->table[i].dwAddr; addr_mtob(&intf->iptable->table[i].dwMask, IP_ADDR_LEN, &entry->intf_addr.addr_bits); } else if (ap < lap) { /* Set aliases. */ ap->addr_type = ADDR_TYPE_IP; ap->addr_ip = intf->iptable->table[i].dwAddr; addr_mtob(&intf->iptable->table[i].dwMask, IP_ADDR_LEN, &ap->addr_bits); ap++, entry->intf_alias_num++; } } } entry->intf_len = (u_char *)ap - (u_char *)entry; } static int _refresh_tables(intf_t *intf) { MIB_IFROW *ifrow; ULONG len; u_int i, ret; /* Get interface table. */ for (len = sizeof(intf->iftable[0]); ; ) { if (intf->iftable) free(intf->iftable); intf->iftable = malloc(len); ret = GetIfTable(intf->iftable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } /* Get IP address table. */ for (len = sizeof(intf->iptable[0]); ; ) { if (intf->iptable) free(intf->iptable); intf->iptable = malloc(len); ret = GetIpAddrTable(intf->iptable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } /* * Map "unfriendly" win32 interface indices to ours. * XXX - like IP_ADAPTER_INFO ComboIndex */ for (i = 0; i < intf->iftable->dwNumEntries; i++) { ifrow = &intf->iftable->table[i]; if (ifrow->dwType < MIB_IF_TYPE_MAX) { _ifcombo_add(&intf->ifcombo[ifrow->dwType], ifrow->dwIndex); } else return (-1); } return (0); } static int _find_ifindex(intf_t *intf, const char *device) { char *p = (char *)device; int n, type = _ifcombo_type(device); while (isalpha(*p)) p++; n = atoi(p); return (intf->ifcombo[type].idx[n]); } intf_t * intf_open(void) { return (calloc(1, sizeof(intf_t))); } int intf_get(intf_t *intf, struct intf_entry *entry) { MIB_IFROW ifrow; if (_refresh_tables(intf) < 0) return (-1); ifrow.dwIndex = _find_ifindex(intf, entry->intf_name); if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } int intf_get_src(intf_t *intf, struct intf_entry *entry, struct addr *src) { MIB_IFROW ifrow; MIB_IPADDRROW *iprow; int i; if (src->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } if (_refresh_tables(intf) < 0) return (-1); for (i = 0; i < (int)intf->iptable->dwNumEntries; i++) { iprow = &intf->iptable->table[i]; if (iprow->dwAddr == src->addr_ip) { ifrow.dwIndex = iprow->dwIndex; if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } } errno = ENXIO; return (-1); } int intf_get_dst(intf_t *intf, struct intf_entry *entry, struct addr *dst) { MIB_IFROW ifrow; if (dst->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } if (GetBestInterface(dst->addr_ip, &ifrow.dwIndex) != NO_ERROR) return (-1); if (GetIfEntry(&ifrow) != NO_ERROR) return (-1); if (_refresh_tables(intf) < 0) return (-1); _ifrow_to_entry(intf, &ifrow, entry); return (0); } int intf_set(intf_t *intf, const struct intf_entry *entry) { /* * XXX - could set interface up/down via SetIfEntry(), * but what about the rest of the configuration? :-( * {Add,Delete}IPAddress for 2000/XP only */ #if 0 /* Set interface address. XXX - 2000/XP only? */ if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { ULONG ctx = 0, inst = 0; UINT ip, mask; memcpy(&ip, &entry->intf_addr.addr_ip, IP_ADDR_LEN); addr_btom(entry->intf_addr.addr_bits, &mask, IP_ADDR_LEN); if (AddIPAddress(ip, mask, _find_ifindex(intf, entry->intf_name), &ctx, &inst) != NO_ERROR) { return (-1); } return (0); } #endif errno = ENOSYS; SetLastError(ERROR_NOT_SUPPORTED); return (-1); } int intf_loop(intf_t *intf, intf_handler callback, void *arg) { struct intf_entry *entry; u_char ebuf[1024]; int i, ret = 0; if (_refresh_tables(intf) < 0) return (-1); entry = (struct intf_entry *)ebuf; for (i = 0; i < (int)intf->iftable->dwNumEntries; i++) { entry->intf_len = sizeof(ebuf); _ifrow_to_entry(intf, &intf->iftable->table[i], entry); if ((ret = (*callback)(entry, arg)) != 0) break; } return (ret); } intf_t * intf_close(intf_t *intf) { int i; if (intf != NULL) { for (i = 0; i < MIB_IF_TYPE_MAX; i++) { if (intf->ifcombo[i].idx) free(intf->ifcombo[i].idx); } if (intf->iftable) free(intf->iftable); if (intf->iptable) free(intf->iptable); free(intf); } return (NULL); } libdnet-1.12/trunk/src/intf.c0000644000076500007650000004270210360406075017272 0ustar dugsongdugsong00000000000000/* * intf.c * * Copyright (c) 2001 Dug Song * * $Id: intf.c 616 2006-01-09 07:09:49Z dugsong $ */ #include "config.h" #include #include #include #include #ifdef HAVE_SYS_SOCKIO_H # include #endif /* XXX - AIX */ #ifndef IP_MULTICAST # define IP_MULTICAST #endif #include #ifdef HAVE_NET_IF_VAR_H # include #endif #undef IP_MULTICAST /* XXX - IPv6 ioctls */ #ifdef HAVE_NETINET_IN_VAR_H # include # include #endif #include #include #include #include #include #include "dnet.h" /* XXX - Tru64 */ #if defined(SIOCRIPMTU) && defined(SIOCSIPMTU) # define SIOCGIFMTU SIOCRIPMTU # define SIOCSIFMTU SIOCSIPMTU #endif /* XXX - HP-UX */ #if defined(SIOCADDIFADDR) && defined(SIOCDELIFADDR) # define SIOCAIFADDR SIOCADDIFADDR # define SIOCDIFADDR SIOCDELIFADDR #endif /* XXX - HP-UX, Solaris */ #if !defined(ifr_mtu) && defined(ifr_metric) # define ifr_mtu ifr_metric #endif #ifdef HAVE_SOCKADDR_SA_LEN # define NEXTIFR(i) ((struct ifreq *)((u_char *)&i->ifr_addr + \ (i->ifr_addr.sa_len ? i->ifr_addr.sa_len : \ sizeof(i->ifr_addr)))) #else # define NEXTIFR(i) (i + 1) #endif /* XXX - superset of ifreq, for portable SIOC{A,D}IFADDR */ struct dnet_ifaliasreq { char ifra_name[IFNAMSIZ]; struct sockaddr ifra_addr; struct sockaddr ifra_brdaddr; struct sockaddr ifra_mask; int ifra_cookie; /* XXX - IRIX!@#$ */ }; struct intf_handle { int fd; int fd6; struct ifconf ifc; u_char ifcbuf[4192]; }; static int intf_flags_to_iff(u_short flags, int iff) { if (flags & INTF_FLAG_UP) iff |= IFF_UP; else iff &= ~IFF_UP; if (flags & INTF_FLAG_NOARP) iff |= IFF_NOARP; else iff &= ~IFF_NOARP; return (iff); } static u_int intf_iff_to_flags(int iff) { u_int n = 0; if (iff & IFF_UP) n |= INTF_FLAG_UP; if (iff & IFF_LOOPBACK) n |= INTF_FLAG_LOOPBACK; if (iff & IFF_POINTOPOINT) n |= INTF_FLAG_POINTOPOINT; if (iff & IFF_NOARP) n |= INTF_FLAG_NOARP; if (iff & IFF_BROADCAST) n |= INTF_FLAG_BROADCAST; if (iff & IFF_MULTICAST) n |= INTF_FLAG_MULTICAST; return (n); } intf_t * intf_open(void) { intf_t *intf; if ((intf = calloc(1, sizeof(*intf))) != NULL) { intf->fd = intf->fd6 = -1; if ((intf->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (intf_close(intf)); #ifdef SIOCGIFNETMASK_IN6 if ((intf->fd6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { # ifdef EPROTONOSUPPORT if (errno != EPROTONOSUPPORT) # endif return (intf_close(intf)); } #endif } return (intf); } static int _intf_delete_addrs(intf_t *intf, struct intf_entry *entry) { #if defined(SIOCDIFADDR) struct dnet_ifaliasreq ifra; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { addr_ntos(&entry->intf_addr, &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { addr_ntos(&entry->intf_dst_addr, &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } #elif defined(SIOCLIFREMOVEIF) struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* XXX - overloading Solaris lifreq with ifreq */ ioctl(intf->fd, SIOCLIFREMOVEIF, &ifr); #endif return (0); } static int _intf_delete_aliases(intf_t *intf, struct intf_entry *entry) { int i; #if defined(SIOCDIFADDR) && !defined(__linux__) /* XXX - see Linux below */ struct dnet_ifaliasreq ifra; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); for (i = 0; i < (int)entry->intf_alias_num; i++) { addr_ntos(&entry->intf_alias_addrs[i], &ifra.ifra_addr); ioctl(intf->fd, SIOCDIFADDR, &ifra); } #else struct ifreq ifr; for (i = 0; i < entry->intf_alias_num; i++) { snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s:%d", entry->intf_name, i + 1); # ifdef SIOCLIFREMOVEIF /* XXX - overloading Solaris lifreq with ifreq */ ioctl(intf->fd, SIOCLIFREMOVEIF, &ifr); # else /* XXX - only need to set interface down on Linux */ ifr.ifr_flags = 0; ioctl(intf->fd, SIOCSIFFLAGS, &ifr); # endif } #endif return (0); } static int _intf_add_aliases(intf_t *intf, const struct intf_entry *entry) { int i; #ifdef SIOCAIFADDR struct dnet_ifaliasreq ifra; struct addr bcast; memset(&ifra, 0, sizeof(ifra)); strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); for (i = 0; i < (int)entry->intf_alias_num; i++) { if (entry->intf_alias_addrs[i].addr_type != ADDR_TYPE_IP) continue; if (addr_ntos(&entry->intf_alias_addrs[i], &ifra.ifra_addr) < 0) return (-1); addr_bcast(&entry->intf_alias_addrs[i], &bcast); addr_ntos(&bcast, &ifra.ifra_brdaddr); addr_btos(entry->intf_alias_addrs[i].addr_bits, &ifra.ifra_mask); if (ioctl(intf->fd, SIOCAIFADDR, &ifra) < 0) return (-1); } #else struct ifreq ifr; int n = 1; for (i = 0; i < entry->intf_alias_num; i++) { if (entry->intf_alias_addrs[i].addr_type != ADDR_TYPE_IP) continue; snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s:%d", entry->intf_name, n++); # ifdef SIOCLIFADDIF if (ioctl(intf->fd, SIOCLIFADDIF, &ifr) < 0) return (-1); # endif if (addr_ntos(&entry->intf_alias_addrs[i], &ifr.ifr_addr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFADDR, &ifr) < 0) return (-1); } strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); #endif return (0); } int intf_set(intf_t *intf, const struct intf_entry *entry) { struct ifreq ifr; struct intf_entry *orig; struct addr bcast; u_char buf[BUFSIZ]; orig = (struct intf_entry *)buf; orig->intf_len = sizeof(buf); strcpy(orig->intf_name, entry->intf_name); if (intf_get(intf, orig) < 0) return (-1); /* Delete any existing aliases. */ if (_intf_delete_aliases(intf, orig) < 0) return (-1); /* Delete any existing addrs. */ if (_intf_delete_addrs(intf, orig) < 0) return (-1); memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* Set interface MTU. */ if (entry->intf_mtu != 0) { ifr.ifr_mtu = entry->intf_mtu; if (ioctl(intf->fd, SIOCSIFMTU, &ifr) < 0) return (-1); } /* Set interface address. */ if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { #ifdef BSD /* XXX - why must this happen before SIOCSIFADDR? */ if (addr_btos(entry->intf_addr.addr_bits, &ifr.ifr_addr) == 0) { if (ioctl(intf->fd, SIOCSIFNETMASK, &ifr) < 0) return (-1); } #endif if (addr_ntos(&entry->intf_addr, &ifr.ifr_addr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFADDR, &ifr) < 0 && errno != EEXIST) return (-1); if (addr_btos(entry->intf_addr.addr_bits, &ifr.ifr_addr) == 0 #ifdef __linux__ && entry->intf_addr.addr_ip != 0 #endif ) { if (ioctl(intf->fd, SIOCSIFNETMASK, &ifr) < 0) return (-1); } if (addr_bcast(&entry->intf_addr, &bcast) == 0) { if (addr_ntos(&bcast, &ifr.ifr_broadaddr) == 0) { /* XXX - ignore error from non-broadcast ifs */ ioctl(intf->fd, SIOCSIFBRDADDR, &ifr); } } } /* Set link-level address. */ if (entry->intf_link_addr.addr_type == ADDR_TYPE_ETH && addr_cmp(&entry->intf_link_addr, &orig->intf_link_addr) != 0) { #if defined(SIOCSIFHWADDR) if (addr_ntos(&entry->intf_link_addr, &ifr.ifr_hwaddr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFHWADDR, &ifr) < 0) return (-1); #elif defined (SIOCSIFLLADDR) memcpy(ifr.ifr_addr.sa_data, &entry->intf_link_addr.addr_eth, ETH_ADDR_LEN); ifr.ifr_addr.sa_len = ETH_ADDR_LEN; if (ioctl(intf->fd, SIOCSIFLLADDR, &ifr) < 0) return (-1); #else eth_t *eth; if ((eth = eth_open(entry->intf_name)) == NULL) return (-1); if (eth_set(eth, &entry->intf_link_addr.addr_eth) < 0) { eth_close(eth); return (-1); } eth_close(eth); #endif } /* Set point-to-point destination. */ if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { if (addr_ntos(&entry->intf_dst_addr, &ifr.ifr_dstaddr) < 0) return (-1); if (ioctl(intf->fd, SIOCSIFDSTADDR, &ifr) < 0 && errno != EEXIST) return (-1); } /* Add aliases. */ if (_intf_add_aliases(intf, entry) < 0) return (-1); /* Set interface flags. */ if (ioctl(intf->fd, SIOCGIFFLAGS, &ifr) < 0) return (-1); ifr.ifr_flags = intf_flags_to_iff(entry->intf_flags, ifr.ifr_flags); if (ioctl(intf->fd, SIOCSIFFLAGS, &ifr) < 0) return (-1); return (0); } /* XXX - this is total crap. how to do this without walking ifnet? */ static void _intf_set_type(struct intf_entry *entry) { if ((entry->intf_flags & INTF_FLAG_BROADCAST) != 0) entry->intf_type = INTF_TYPE_ETH; else if ((entry->intf_flags & INTF_FLAG_POINTOPOINT) != 0) entry->intf_type = INTF_TYPE_TUN; else if ((entry->intf_flags & INTF_FLAG_LOOPBACK) != 0) entry->intf_type = INTF_TYPE_LOOPBACK; else entry->intf_type = INTF_TYPE_OTHER; } static int _intf_get_noalias(intf_t *intf, struct intf_entry *entry) { struct ifreq ifr; strlcpy(ifr.ifr_name, entry->intf_name, sizeof(ifr.ifr_name)); /* Get interface flags. */ if (ioctl(intf->fd, SIOCGIFFLAGS, &ifr) < 0) return (-1); entry->intf_flags = intf_iff_to_flags(ifr.ifr_flags); _intf_set_type(entry); /* Get interface MTU. */ if (ioctl(intf->fd, SIOCGIFMTU, &ifr) < 0) return (-1); entry->intf_mtu = ifr.ifr_mtu; entry->intf_addr.addr_type = entry->intf_dst_addr.addr_type = entry->intf_link_addr.addr_type = ADDR_TYPE_NONE; /* Get primary interface address. */ if (ioctl(intf->fd, SIOCGIFADDR, &ifr) == 0) { addr_ston(&ifr.ifr_addr, &entry->intf_addr); if (ioctl(intf->fd, SIOCGIFNETMASK, &ifr) < 0) return (-1); addr_stob(&ifr.ifr_addr, &entry->intf_addr.addr_bits); } /* Get other addresses. */ if (entry->intf_type == INTF_TYPE_TUN) { if (ioctl(intf->fd, SIOCGIFDSTADDR, &ifr) == 0) { if (addr_ston(&ifr.ifr_addr, &entry->intf_dst_addr) < 0) return (-1); } } else if (entry->intf_type == INTF_TYPE_ETH) { #if defined(SIOCGIFHWADDR) if (ioctl(intf->fd, SIOCGIFHWADDR, &ifr) < 0) return (-1); if (addr_ston(&ifr.ifr_addr, &entry->intf_link_addr) < 0) return (-1); #elif defined(SIOCRPHYSADDR) /* Tru64 */ struct ifdevea *ifd = (struct ifdevea *)𝔦 /* XXX */ if (ioctl(intf->fd, SIOCRPHYSADDR, ifd) < 0) return (-1); addr_pack(&entry->intf_link_addr, ADDR_TYPE_ETH, ETH_ADDR_BITS, ifd->current_pa, ETH_ADDR_LEN); #else eth_t *eth; if ((eth = eth_open(entry->intf_name)) != NULL) { if (!eth_get(eth, &entry->intf_link_addr.addr_eth)) { entry->intf_link_addr.addr_type = ADDR_TYPE_ETH; entry->intf_link_addr.addr_bits = ETH_ADDR_BITS; } eth_close(eth); } #endif } return (0); } #ifdef SIOCLIFADDR /* XXX - aliases on IRIX don't show up in SIOCGIFCONF */ static int _intf_get_aliases(intf_t *intf, struct intf_entry *entry) { struct dnet_ifaliasreq ifra; struct addr *ap, *lap; strlcpy(ifra.ifra_name, entry->intf_name, sizeof(ifra.ifra_name)); addr_ntos(&entry->intf_addr, &ifra.ifra_addr); addr_btos(entry->intf_addr.addr_bits, &ifra.ifra_mask); memset(&ifra.ifra_brdaddr, 0, sizeof(ifra.ifra_brdaddr)); ifra.ifra_cookie = 1; ap = entry->intf_alias_addrs; lap = (struct addr *)((u_char *)entry + entry->intf_len); while (ioctl(intf->fd, SIOCLIFADDR, &ifra) == 0 && ifra.ifra_cookie > 0 && (ap + 1) < lap) { if (addr_ston(&ifra.ifra_addr, ap) < 0) break; ap++, entry->intf_alias_num++; } entry->intf_len = (u_char *)ap - (u_char *)entry; return (0); } #else static int _intf_get_aliases(intf_t *intf, struct intf_entry *entry) { struct ifreq *ifr, *lifr; struct addr *ap, *lap; char *p; if (intf->ifc.ifc_len < (int)sizeof(*ifr)) { errno = EINVAL; return (-1); } entry->intf_alias_num = 0; ap = entry->intf_alias_addrs; lifr = (struct ifreq *)intf->ifc.ifc_buf + (intf->ifc.ifc_len / sizeof(*lifr)); lap = (struct addr *)((u_char *)entry + entry->intf_len); /* Get addresses for this interface. */ for (ifr = intf->ifc.ifc_req; ifr < lifr && (ap + 1) < lap; ifr = NEXTIFR(ifr)) { /* XXX - Linux, Solaris ifaliases */ if ((p = strchr(ifr->ifr_name, ':')) != NULL) *p = '\0'; if (strcmp(ifr->ifr_name, entry->intf_name) != 0) continue; if (addr_ston(&ifr->ifr_addr, ap) < 0) continue; /* XXX */ if (ap->addr_type == ADDR_TYPE_ETH) { memcpy(&entry->intf_link_addr, ap, sizeof(*ap)); continue; } else if (ap->addr_type == ADDR_TYPE_IP) { if (ap->addr_ip == entry->intf_addr.addr_ip || ap->addr_ip == entry->intf_dst_addr.addr_ip) continue; } #ifdef SIOCGIFNETMASK_IN6 else if (ap->addr_type == ADDR_TYPE_IP6 && intf->fd6 != -1) { struct in6_ifreq ifr6; /* XXX - sizeof(ifr) < sizeof(ifr6) */ memcpy(&ifr6, ifr, sizeof(ifr6)); if (ioctl(intf->fd6, SIOCGIFNETMASK_IN6, &ifr6) == 0) { addr_stob((struct sockaddr *)&ifr6.ifr_addr, &ap->addr_bits); } else perror("SIOCGIFNETMASK_IN6"); } #endif ap++, entry->intf_alias_num++; } #ifdef HAVE_LINUX_PROCFS #define PROC_INET6_FILE "/proc/net/if_inet6" { FILE *f; char buf[256], s[8][5], name[INTF_NAME_LEN]; u_int idx, bits, scope, flags; if ((f = fopen(PROC_INET6_FILE, "r")) != NULL) { while (ap < lap && fgets(buf, sizeof(buf), f) != NULL) { sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x %02x %02x %02x %32s\n", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], &idx, &bits, &scope, &flags, name); if (strcmp(name, entry->intf_name) == 0) { snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], bits); addr_aton(buf, ap); ap++, entry->intf_alias_num++; } } fclose(f); } } #endif entry->intf_len = (u_char *)ap - (u_char *)entry; return (0); } #endif /* SIOCLIFADDR */ int intf_get(intf_t *intf, struct intf_entry *entry) { if (_intf_get_noalias(intf, entry) < 0) return (-1); #ifndef SIOCLIFADDR intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); #endif return (_intf_get_aliases(intf, entry)); } static int _match_intf_src(const struct intf_entry *entry, void *arg) { struct intf_entry *save = (struct intf_entry *)arg; if (entry->intf_addr.addr_type == ADDR_TYPE_IP && entry->intf_addr.addr_ip == save->intf_addr.addr_ip) { /* XXX - truncated result if entry is too small. */ if (save->intf_len < entry->intf_len) memcpy(save, entry, save->intf_len); else memcpy(save, entry, entry->intf_len); return (1); } return (0); } int intf_get_src(intf_t *intf, struct intf_entry *entry, struct addr *src) { memcpy(&entry->intf_addr, src, sizeof(*src)); if (intf_loop(intf, _match_intf_src, entry) != 1) { errno = ENXIO; return (-1); } return (0); } int intf_get_dst(intf_t *intf, struct intf_entry *entry, struct addr *dst) { struct sockaddr_in sin; int n; if (dst->addr_type != ADDR_TYPE_IP) { errno = EINVAL; return (-1); } addr_ntos(dst, (struct sockaddr *)&sin); sin.sin_port = htons(666); if (connect(intf->fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) return (-1); n = sizeof(sin); if (getsockname(intf->fd, (struct sockaddr *)&sin, &n) < 0) return (-1); addr_ston((struct sockaddr *)&sin, &entry->intf_addr); if (intf_loop(intf, _match_intf_src, entry) != 1) return (-1); return (0); } #ifdef HAVE_LINUX_PROCFS #define PROC_DEV_FILE "/proc/net/dev" int intf_loop(intf_t *intf, intf_handler callback, void *arg) { FILE *fp; struct intf_entry *entry; char *p, buf[BUFSIZ], ebuf[BUFSIZ]; int ret; entry = (struct intf_entry *)ebuf; if ((fp = fopen(PROC_DEV_FILE, "r")) == NULL) return (-1); intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); ret = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { if ((p = strchr(buf, ':')) == NULL) continue; *p = '\0'; for (p = buf; *p == ' '; p++) ; memset(ebuf, 0, sizeof(ebuf)); strlcpy(entry->intf_name, p, sizeof(entry->intf_name)); entry->intf_len = sizeof(ebuf); if (_intf_get_noalias(intf, entry) < 0) { ret = -1; break; } if (_intf_get_aliases(intf, entry) < 0) { ret = -1; break; } if ((ret = (*callback)(entry, arg)) != 0) break; } if (ferror(fp)) ret = -1; fclose(fp); return (ret); } #else int intf_loop(intf_t *intf, intf_handler callback, void *arg) { struct intf_entry *entry; struct ifreq *ifr, *lifr, *pifr; char *p, ebuf[BUFSIZ]; int ret; entry = (struct intf_entry *)ebuf; intf->ifc.ifc_buf = (caddr_t)intf->ifcbuf; intf->ifc.ifc_len = sizeof(intf->ifcbuf); if (ioctl(intf->fd, SIOCGIFCONF, &intf->ifc) < 0) return (-1); pifr = NULL; lifr = (struct ifreq *)&intf->ifc.ifc_buf[intf->ifc.ifc_len]; for (ifr = intf->ifc.ifc_req; ifr < lifr; ifr = NEXTIFR(ifr)) { /* XXX - Linux, Solaris ifaliases */ if ((p = strchr(ifr->ifr_name, ':')) != NULL) *p = '\0'; if (pifr != NULL && strcmp(ifr->ifr_name, pifr->ifr_name) == 0) continue; memset(ebuf, 0, sizeof(ebuf)); strlcpy(entry->intf_name, ifr->ifr_name, sizeof(entry->intf_name)); entry->intf_len = sizeof(ebuf); if (_intf_get_noalias(intf, entry) < 0) return (-1); if (_intf_get_aliases(intf, entry) < 0) return (-1); if ((ret = (*callback)(entry, arg)) != 0) return (ret); pifr = ifr; } return (0); } #endif /* !HAVE_LINUX_PROCFS */ intf_t * intf_close(intf_t *intf) { if (intf != NULL) { if (intf->fd >= 0) close(intf->fd); if (intf->fd6 >= 0) close(intf->fd6); free(intf); } return (NULL); } libdnet-1.12/trunk/src/ip-cooked.c0000644000076500007650000001242510175535200020200 0ustar dugsongdugsong00000000000000/* * ip-cooked.c * * Copyright (c) 2001 Dug Song * * $Id: ip-cooked.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #ifndef _WIN32 #include #include #endif #include #include #include #include #include "dnet.h" #include "queue.h" struct ip_intf { eth_t *eth; char name[INTF_NAME_LEN]; struct addr ha; struct addr pa; int mtu; LIST_ENTRY(ip_intf) next; }; struct ip_handle { arp_t *arp; intf_t *intf; route_t *route; int fd; struct sockaddr_in sin; LIST_HEAD(, ip_intf) ip_intf_list; }; static int _add_ip_intf(const struct intf_entry *entry, void *arg) { ip_t *ip = (ip_t *)arg; struct ip_intf *ipi; if (entry->intf_type == INTF_TYPE_ETH && (entry->intf_flags & INTF_FLAG_UP) != 0 && entry->intf_mtu >= ETH_LEN_MIN && entry->intf_addr.addr_type == ADDR_TYPE_IP && entry->intf_link_addr.addr_type == ADDR_TYPE_ETH) { if ((ipi = calloc(1, sizeof(*ipi))) == NULL) return (-1); strlcpy(ipi->name, entry->intf_name, sizeof(ipi->name)); memcpy(&ipi->ha, &entry->intf_link_addr, sizeof(ipi->ha)); memcpy(&ipi->pa, &entry->intf_addr, sizeof(ipi->pa)); ipi->mtu = entry->intf_mtu; LIST_INSERT_HEAD(&ip->ip_intf_list, ipi, next); } return (0); } ip_t * ip_open(void) { ip_t *ip; if ((ip = calloc(1, sizeof(*ip))) != NULL) { ip->fd = -1; if ((ip->arp = arp_open()) == NULL || (ip->intf = intf_open()) == NULL || (ip->route = route_open()) == NULL) return (ip_close(ip)); if ((ip->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (ip_close(ip)); memset(&ip->sin, 0, sizeof(ip->sin)); ip->sin.sin_family = AF_INET; ip->sin.sin_port = htons(666); LIST_INIT(&ip->ip_intf_list); if (intf_loop(ip->intf, _add_ip_intf, ip) != 0) return (ip_close(ip)); } return (ip); } static struct ip_intf * _lookup_ip_intf(ip_t *ip, ip_addr_t dst) { struct ip_intf *ipi; int n; ip->sin.sin_addr.s_addr = dst; n = sizeof(ip->sin); if (connect(ip->fd, (struct sockaddr *)&ip->sin, n) < 0) return (NULL); if (getsockname(ip->fd, (struct sockaddr *)&ip->sin, &n) < 0) return (NULL); LIST_FOREACH(ipi, &ip->ip_intf_list, next) { if (ipi->pa.addr_ip == ip->sin.sin_addr.s_addr) { if (ipi->eth == NULL) { if ((ipi->eth = eth_open(ipi->name)) == NULL) return (NULL); } if (ipi != LIST_FIRST(&ip->ip_intf_list)) { LIST_REMOVE(ipi, next); LIST_INSERT_HEAD(&ip->ip_intf_list, ipi, next); } return (ipi); } } return (NULL); } static void _request_arp(struct ip_intf *ipi, struct addr *dst) { u_char frame[ETH_HDR_LEN + ARP_HDR_LEN + ARP_ETHIP_LEN]; eth_pack_hdr(frame, ETH_ADDR_BROADCAST, ipi->ha.addr_eth, ETH_TYPE_ARP); arp_pack_hdr_ethip(frame + ETH_HDR_LEN, ARP_OP_REQUEST, ipi->ha.addr_eth, ipi->pa.addr_ip, ETH_ADDR_BROADCAST, dst->addr_ip); eth_send(ipi->eth, frame, sizeof(frame)); } ssize_t ip_send(ip_t *ip, const void *buf, size_t len) { struct ip_hdr *iph; struct ip_intf *ipi; struct arp_entry arpent; struct route_entry rtent; u_char frame[ETH_LEN_MAX]; int i, usec; iph = (struct ip_hdr *)buf; if ((ipi = _lookup_ip_intf(ip, iph->ip_dst)) == NULL) { errno = EHOSTUNREACH; return (-1); } arpent.arp_pa.addr_type = ADDR_TYPE_IP; arpent.arp_pa.addr_bits = IP_ADDR_BITS; arpent.arp_pa.addr_ip = iph->ip_dst; memcpy(&rtent.route_dst, &arpent.arp_pa, sizeof(rtent.route_dst)); for (i = 0, usec = 10; i < 3; i++, usec *= 100) { if (arp_get(ip->arp, &arpent) == 0) break; if (route_get(ip->route, &rtent) == 0 && rtent.route_gw.addr_ip != ipi->pa.addr_ip) { memcpy(&arpent.arp_pa, &rtent.route_gw, sizeof(arpent.arp_pa)); if (arp_get(ip->arp, &arpent) == 0) break; } _request_arp(ipi, &arpent.arp_pa); usleep(usec); } if (i == 3) memset(&arpent.arp_ha.addr_eth, 0xff, ETH_ADDR_LEN); eth_pack_hdr(frame, arpent.arp_ha.addr_eth, ipi->ha.addr_eth, ETH_TYPE_IP); if (len > ipi->mtu) { u_char *p, *start, *end, *ip_data; int ip_hl, fraglen; ip_hl = iph->ip_hl << 2; fraglen = ipi->mtu - ip_hl; iph = (struct ip_hdr *)(frame + ETH_HDR_LEN); memcpy(iph, buf, ip_hl); ip_data = (u_char *)iph + ip_hl; start = (u_char *)buf + ip_hl; end = (u_char *)buf + len; for (p = start; p < end; ) { memcpy(ip_data, p, fraglen); iph->ip_len = htons(ip_hl + fraglen); iph->ip_off = htons(((p + fraglen < end) ? IP_MF : 0) | ((p - start) >> 3)); ip_checksum(iph, ip_hl + fraglen); i = ETH_HDR_LEN + ip_hl + fraglen; if (eth_send(ipi->eth, frame, i) != i) return (-1); p += fraglen; if (end - p < fraglen) fraglen = end - p; } return (len); } memcpy(frame + ETH_HDR_LEN, buf, len); i = ETH_HDR_LEN + len; if (eth_send(ipi->eth, frame, i) != i) return (-1); return (len); } ip_t * ip_close(ip_t *ip) { struct ip_intf *ipi, *nxt; if (ip != NULL) { for (ipi = LIST_FIRST(&ip->ip_intf_list); ipi != LIST_END(&ip->ip_intf_list); ipi = nxt) { nxt = LIST_NEXT(ipi, next); if (ipi->eth != NULL) eth_close(ipi->eth); free(ipi); } if (ip->fd >= 0) close(ip->fd); if (ip->route != NULL) route_close(ip->route); if (ip->intf != NULL) intf_close(ip->intf); if (ip->arp != NULL) arp_close(ip->arp); free(ip); } return (NULL); } libdnet-1.12/trunk/src/ip-util.c0000644000076500007650000000715210205003674017711 0ustar dugsongdugsong00000000000000/* * ip-util.c * * Copyright (c) 2002 Dug Song * * $Id: ip-util.c 595 2005-02-17 02:55:56Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" ssize_t ip_add_option(void *buf, size_t len, int proto, const void *optbuf, size_t optlen) { struct ip_hdr *ip; struct tcp_hdr *tcp = NULL; u_char *p; int hl, datalen, padlen; if (proto != IP_PROTO_IP && proto != IP_PROTO_TCP) { errno = EINVAL; return (-1); } ip = (struct ip_hdr *)buf; hl = ip->ip_hl << 2; p = (u_char *)buf + hl; if (proto == IP_PROTO_TCP) { tcp = (struct tcp_hdr *)p; hl = tcp->th_off << 2; p = (u_char *)tcp + hl; } datalen = ntohs(ip->ip_len) - (p - (u_char *)buf); /* Compute padding to next word boundary. */ if ((padlen = 4 - (optlen % 4)) == 4) padlen = 0; /* XXX - IP_HDR_LEN_MAX == TCP_HDR_LEN_MAX */ if (hl + optlen + padlen > IP_HDR_LEN_MAX || ntohs(ip->ip_len) + optlen + padlen > len) { errno = EINVAL; return (-1); } /* XXX - IP_OPT_TYPEONLY() == TCP_OPT_TYPEONLY */ if (IP_OPT_TYPEONLY(((struct ip_opt *)optbuf)->opt_type)) optlen = 1; /* Shift any existing data. */ if (datalen) { memmove(p + optlen + padlen, p, datalen); } /* XXX - IP_OPT_NOP == TCP_OPT_NOP */ if (padlen) { memset(p, IP_OPT_NOP, padlen); p += padlen; } memmove(p, optbuf, optlen); p += optlen; optlen += padlen; if (proto == IP_PROTO_IP) ip->ip_hl = (p - (u_char *)ip) >> 2; else if (proto == IP_PROTO_TCP) tcp->th_off = (p - (u_char *)tcp) >> 2; ip->ip_len = htons(ntohs(ip->ip_len) + optlen); return (optlen); } void ip_checksum(void *buf, size_t len) { struct ip_hdr *ip; int hl, off, sum; if (len < IP_HDR_LEN) return; ip = (struct ip_hdr *)buf; hl = ip->ip_hl << 2; ip->ip_sum = 0; sum = ip_cksum_add(ip, hl, 0); ip->ip_sum = ip_cksum_carry(sum); off = htons(ip->ip_off); if ((off & IP_OFFMASK) != 0 || (off & IP_MF) != 0) return; len -= hl; if (ip->ip_p == IP_PROTO_TCP) { struct tcp_hdr *tcp = (struct tcp_hdr *)((u_char *)ip + hl); if (len >= TCP_HDR_LEN) { tcp->th_sum = 0; sum = ip_cksum_add(tcp, len, 0) + htons(ip->ip_p + len); sum = ip_cksum_add(&ip->ip_src, 8, sum); tcp->th_sum = ip_cksum_carry(sum); } } else if (ip->ip_p == IP_PROTO_UDP) { struct udp_hdr *udp = (struct udp_hdr *)((u_char *)ip + hl); if (len >= UDP_HDR_LEN) { udp->uh_sum = 0; sum = ip_cksum_add(udp, len, 0) + htons(ip->ip_p + len); sum = ip_cksum_add(&ip->ip_src, 8, sum); udp->uh_sum = ip_cksum_carry(sum); if (!udp->uh_sum) udp->uh_sum = 0xffff; /* RFC 768 */ } } else if (ip->ip_p == IP_PROTO_ICMP || ip->ip_p == IP_PROTO_IGMP) { struct icmp_hdr *icmp = (struct icmp_hdr *)((u_char *)ip + hl); if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0); icmp->icmp_cksum = ip_cksum_carry(sum); } } } int ip_cksum_add(const void *buf, size_t len, int cksum) { uint16_t *sp = (uint16_t *)buf; int n, sn; sn = len / 2; n = (sn + 15) / 16; /* XXX - unroll loop using Duff's device. */ switch (sn % 16) { case 0: do { cksum += *sp++; case 15: cksum += *sp++; case 14: cksum += *sp++; case 13: cksum += *sp++; case 12: cksum += *sp++; case 11: cksum += *sp++; case 10: cksum += *sp++; case 9: cksum += *sp++; case 8: cksum += *sp++; case 7: cksum += *sp++; case 6: cksum += *sp++; case 5: cksum += *sp++; case 4: cksum += *sp++; case 3: cksum += *sp++; case 2: cksum += *sp++; case 1: cksum += *sp++; } while (--n > 0); } if (len & 1) cksum += htons(*(u_char *)sp << 8); return (cksum); } libdnet-1.12/trunk/src/ip-win32.c0000644000076500007650000000247310175535200017700 0ustar dugsongdugsong00000000000000/* * ip-win32.c * * Copyright (c) 2002 Dug Song * * $Id: ip-win32.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include "dnet.h" struct ip_handle { WSADATA wsdata; SOCKET fd; struct sockaddr_in sin; }; ip_t * ip_open(void) { BOOL on; ip_t *ip; if ((ip = calloc(1, sizeof(*ip))) != NULL) { if (WSAStartup(MAKEWORD(2, 2), &ip->wsdata) != 0) { free(ip); return (NULL); } if ((ip->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == INVALID_SOCKET) return (ip_close(ip)); on = TRUE; if (setsockopt(ip->fd, IPPROTO_IP, IP_HDRINCL, (const char *)&on, sizeof(on)) == SOCKET_ERROR) { SetLastError(ERROR_NETWORK_ACCESS_DENIED); return (ip_close(ip)); } ip->sin.sin_family = AF_INET; ip->sin.sin_port = htons(666); } return (ip); } ssize_t ip_send(ip_t *ip, const void *buf, size_t len) { struct ip_hdr *hdr = (struct ip_hdr *)buf; ip->sin.sin_addr.s_addr = hdr->ip_src; if ((len = sendto(ip->fd, (const char *)buf, len, 0, (struct sockaddr *)&ip->sin, sizeof(ip->sin))) != SOCKET_ERROR) return (len); return (-1); } ip_t * ip_close(ip_t *ip) { if (ip != NULL) { WSACleanup(); if (ip->fd != INVALID_SOCKET) closesocket(ip->fd); free(ip); } return (NULL); } libdnet-1.12/trunk/src/ip.c0000644000076500007650000000346010175535200016735 0ustar dugsongdugsong00000000000000/* * ip.c * * Copyright (c) 2000 Dug Song * * $Id: ip.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" struct ip_handle { int fd; }; ip_t * ip_open(void) { ip_t *i; int n, len; if ((i = calloc(1, sizeof(*i))) == NULL) return (NULL); if ((i->fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) return (ip_close(i)); #ifdef IP_HDRINCL n = 1; if (setsockopt(i->fd, IPPROTO_IP, IP_HDRINCL, &n, sizeof(n)) < 0) return (ip_close(i)); #endif #ifdef SO_SNDBUF len = sizeof(n); if (getsockopt(i->fd, SOL_SOCKET, SO_SNDBUF, &n, &len) < 0) return (ip_close(i)); for (n += 128; n < 1048576; n += 128) { if (setsockopt(i->fd, SOL_SOCKET, SO_SNDBUF, &n, len) < 0) { if (errno == ENOBUFS) break; return (ip_close(i)); } } #endif #ifdef SO_BROADCAST n = 1; if (setsockopt(i->fd, SOL_SOCKET, SO_BROADCAST, &n, sizeof(n)) < 0) return (ip_close(i)); #endif return (i); } ssize_t ip_send(ip_t *i, const void *buf, size_t len) { struct ip_hdr *ip; struct sockaddr_in sin; ip = (struct ip_hdr *)buf; memset(&sin, 0, sizeof(sin)); #ifdef HAVE_SOCKADDR_SA_LEN sin.sin_len = sizeof(sin); #endif sin.sin_family = AF_INET; sin.sin_addr.s_addr = ip->ip_dst; #ifdef HAVE_RAWIP_HOST_OFFLEN ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); len = sendto(i->fd, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)); ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); return (len); #else return (sendto(i->fd, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin))); #endif } ip_t * ip_close(ip_t *i) { if (i != NULL) { if (i->fd >= 0) close(i->fd); free(i); } return (NULL); } libdnet-1.12/trunk/src/ip6.c0000644000076500007650000000342310174652026017027 0ustar dugsongdugsong00000000000000/* * ip6.c * * Copyright (c) 2002 Dug Song * * $Id: ip6.c 539 2005-01-23 07:36:54Z dugsong $ */ #include "config.h" #include "dnet.h" #define IP6_IS_EXT(n) \ ((n) == IP_PROTO_HOPOPTS || (n) == IP_PROTO_DSTOPTS || \ (n) == IP_PROTO_ROUTING || (n) == IP_PROTO_FRAGMENT) void ip6_checksum(void *buf, size_t len) { struct ip6_hdr *ip6 = (struct ip6_hdr *)buf; struct ip6_ext_hdr *ext; u_char *p, nxt; int i, sum; nxt = ip6->ip6_nxt; for (i = IP6_HDR_LEN; IP6_IS_EXT(nxt); i += (ext->ext_len + 1) << 3) { if (i >= (int)len) return; ext = (struct ip6_ext_hdr *)((u_char *)buf + i); nxt = ext->ext_nxt; } p = (u_char *)buf + i; len -= i; if (nxt == IP_PROTO_TCP) { struct tcp_hdr *tcp = (struct tcp_hdr *)p; if (len >= TCP_HDR_LEN) { tcp->th_sum = 0; sum = ip_cksum_add(tcp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); tcp->th_sum = ip_cksum_carry(sum); } } else if (nxt == IP_PROTO_UDP) { struct udp_hdr *udp = (struct udp_hdr *)p; if (len >= UDP_HDR_LEN) { udp->uh_sum = 0; sum = ip_cksum_add(udp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); if ((udp->uh_sum = ip_cksum_carry(sum)) == 0) udp->uh_sum = 0xffff; } } else if (nxt == IP_PROTO_ICMPV6) { struct icmp_hdr *icmp = (struct icmp_hdr *)p; if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0) + htons(nxt + len); sum = ip_cksum_add(&ip6->ip6_src, 32, sum); icmp->icmp_cksum = ip_cksum_carry(sum); } } else if (nxt == IP_PROTO_ICMP || nxt == IP_PROTO_IGMP) { struct icmp_hdr *icmp = (struct icmp_hdr *)p; if (len >= ICMP_HDR_LEN) { icmp->icmp_cksum = 0; sum = ip_cksum_add(icmp, len, 0); icmp->icmp_cksum = ip_cksum_carry(sum); } } } libdnet-1.12/trunk/src/Makefile.am0000644000076500007650000000042110363626565020225 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 625 2006-01-19 06:11:01Z dugsong $ include $(top_srcdir)/Makefile.am.common lib_LTLIBRARIES = libdnet.la libdnet_la_SOURCES = addr-util.c addr.c blob.c ip-util.c ip6.c rand.c libdnet_la_LIBADD = @LTLIBOBJS@ libdnet_la_LDFLAGS = -version-info 1:1:0 libdnet-1.12/trunk/src/Makefile.in0000644000076500007650000002372210363627052020237 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = libdnet.la libdnet_la_SOURCES = addr-util.c addr.c blob.c ip-util.c ip6.c rand.c libdnet_la_LIBADD = @LTLIBOBJS@ libdnet_la_LDFLAGS = -version-info 1:1:0 subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) libdnet_la_DEPENDENCIES = @LTLIBOBJS@ am_libdnet_la_OBJECTS = addr-util.lo addr.lo blob.lo ip-util.lo ip6.lo \ rand.lo libdnet_la_OBJECTS = $(am_libdnet_la_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libdnet_la_SOURCES) DIST_COMMON = Makefile.am Makefile.in arp-bsd.c arp-ioctl.c arp-none.c \ arp-win32.c err.c eth-bsd.c eth-dlpi.c eth-linux.c eth-ndd.c \ eth-none.c eth-pfilt.c eth-snoop.c eth-win32.c fw-ipchains.c \ fw-ipf.c fw-ipfw.c fw-none.c fw-pf.c fw-pktfilter.c \ intf-win32.c intf.c ip-cooked.c ip-win32.c ip.c memcmp.c \ route-bsd.c route-hpux.c route-linux.c route-none.c \ route-win32.c strlcat.c strlcpy.c strsep.c tun-bsd.c \ tun-linux.c tun-none.c tun-solaris.c SOURCES = $(libdnet_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) libLTLIBRARIES_INSTALL = $(INSTALL) install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test -z "$dir" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdnet.la: $(libdnet_la_OBJECTS) $(libdnet_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libdnet_la_LDFLAGS) $(libdnet_la_OBJECTS) $(libdnet_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-libLTLIBRARIES install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ tags uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES # 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: libdnet-1.12/trunk/src/memcmp.c0000644000076500007650000000445207361216262017614 0ustar dugsongdugsong00000000000000/*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: memcmp.c,v 1.2 1996/08/19 08:34:05 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include /* * Compare memory regions. */ int memcmp(s1, s2, n) const void *s1, *s2; size_t n; { if (n != 0) { register const unsigned char *p1 = s1, *p2 = s2; do { if (*p1++ != *p2++) return (*--p1 - *--p2); } while (--n != 0); } return (0); } libdnet-1.12/trunk/src/rand.c0000644000076500007650000000702410204314223017242 0ustar dugsongdugsong00000000000000/* * rand.c * * Pseudorandom number generation, based on OpenBSD arc4random(). * * Copyright (c) 2000 Dug Song * Copyright (c) 1996 David Mazieres * * $Id: rand.c 587 2005-02-15 06:37:07Z dugsong $ */ #include "config.h" #ifdef _WIN32 /* XXX */ # undef _WIN32_WINNT # define _WIN32_WINNT 0x0400 # include # define inline __inline #else # include # include # include #endif #include #include #include #include "dnet.h" struct rand_handle { uint8_t i; uint8_t j; uint8_t s[256]; u_char *tmp; int tmplen; }; static inline void rand_init(rand_t *rand) { int i; for (i = 0; i < 256; i++) rand->s[i] = i; rand->i = rand->j = 0; } static inline void rand_addrandom(rand_t *rand, u_char *buf, int len) { int i; uint8_t si; rand->i--; for (i = 0; i < 256; i++) { rand->i = (rand->i + 1); si = rand->s[rand->i]; rand->j = (rand->j + si + buf[i % len]); rand->s[rand->i] = rand->s[rand->j]; rand->s[rand->j] = si; } rand->j = rand->i; } rand_t * rand_open(void) { rand_t *r; u_char seed[256]; #ifdef _WIN32 HCRYPTPROV hcrypt = 0; CryptAcquireContext(&hcrypt, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); CryptGenRandom(hcrypt, sizeof(seed), seed); CryptReleaseContext(hcrypt, 0); #else struct timeval *tv = (struct timeval *)seed; int fd; if ((fd = open("/dev/arandom", O_RDONLY)) != -1 || (fd = open("/dev/urandom", O_RDONLY)) != -1) { read(fd, seed + sizeof(*tv), sizeof(seed) - sizeof(*tv)); close(fd); } gettimeofday(tv, NULL); #endif if ((r = malloc(sizeof(*r))) != NULL) { rand_init(r); rand_addrandom(r, seed, 128); rand_addrandom(r, seed + 128, 128); r->tmp = NULL; r->tmplen = 0; } return (r); } static uint8_t rand_getbyte(rand_t *r) { uint8_t si, sj; r->i = (r->i + 1); si = r->s[r->i]; r->j = (r->j + si); sj = r->s[r->j]; r->s[r->i] = sj; r->s[r->j] = si; return (r->s[(si + sj) & 0xff]); } int rand_get(rand_t *r, void *buf, size_t len) { u_char *p; u_int i; for (p = buf, i = 0; i < len; i++) { p[i] = rand_getbyte(r); } return (0); } int rand_set(rand_t *r, const void *buf, size_t len) { rand_init(r); rand_addrandom(r, (u_char *)buf, len); rand_addrandom(r, (u_char *)buf, len); return (0); } int rand_add(rand_t *r, const void *buf, size_t len) { rand_addrandom(r, (u_char *)buf, len); return (0); } uint8_t rand_uint8(rand_t *r) { return (rand_getbyte(r)); } uint16_t rand_uint16(rand_t *r) { uint16_t val; val = rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } uint32_t rand_uint32(rand_t *r) { uint32_t val; val = rand_getbyte(r) << 24; val |= rand_getbyte(r) << 16; val |= rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } int rand_shuffle(rand_t *r, void *base, size_t nmemb, size_t size) { u_char *save, *src, *dst, *start = (u_char *)base; u_int i, j; if (nmemb < 2) return (0); if ((u_int)r->tmplen < size) { if (r->tmp == NULL) { if ((save = malloc(size)) == NULL) return (-1); } else if ((save = realloc(r->tmp, size)) == NULL) return (-1); r->tmp = save; r->tmplen = size; } else save = r->tmp; for (i = 0; i < nmemb; i++) { if ((j = rand_uint32(r) % (nmemb - 1)) != i) { src = start + (size * i); dst = start + (size * j); memcpy(save, dst, size); memcpy(dst, src, size); memcpy(src, save, size); } } return (0); } rand_t * rand_close(rand_t *r) { if (r != NULL) { if (r->tmp != NULL) free(r->tmp); free(r); } return (NULL); } libdnet-1.12/trunk/src/route-bsd.c0000644000076500007650000002567710202567256020256 0ustar dugsongdugsong00000000000000/* * route-bsd.c * * Copyright (c) 2001 Dug Song * Copyright (c) 1999 Masaki Hirabaru * * $Id: route-bsd.c 555 2005-02-10 05:18:38Z dugsong $ */ #include "config.h" #include #include #include #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_STREAMS_MIB2 #include #include #include #include #include #include #undef IP_ADDR_LEN #include #elif defined(HAVE_STREAMS_ROUTE) #include #include #endif #define route_t oroute_t /* XXX - unixware */ #include #undef route_t #include #include #include #include #include #include #include #include "dnet.h" #define ROUNDUP(a) \ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #ifdef HAVE_SOCKADDR_SA_LEN #define NEXTSA(s) \ ((struct sockaddr *)((u_char *)(s) + ROUNDUP((s)->sa_len))) #else #define NEXTSA(s) \ ((struct sockaddr *)((u_char *)(s) + ROUNDUP(sizeof(*(s))))) #endif struct route_handle { int fd; int seq; #ifdef HAVE_STREAMS_MIB2 int ip_fd; #endif }; #ifdef DEBUG static void route_msg_print(struct rt_msghdr *rtm) { printf("v: %d type: 0x%x flags: 0x%x addrs: 0x%x pid: %d seq: %d\n", rtm->rtm_version, rtm->rtm_type, rtm->rtm_flags, rtm->rtm_addrs, rtm->rtm_pid, rtm->rtm_seq); } #endif static int route_msg(route_t *r, int type, struct addr *dst, struct addr *gw) { struct addr net; struct rt_msghdr *rtm; struct sockaddr *sa; u_char buf[BUFSIZ]; pid_t pid; int len; memset(buf, 0, sizeof(buf)); rtm = (struct rt_msghdr *)buf; rtm->rtm_version = RTM_VERSION; if ((rtm->rtm_type = type) != RTM_DELETE) rtm->rtm_flags = RTF_UP; rtm->rtm_addrs = RTA_DST; rtm->rtm_seq = ++r->seq; /* Destination */ sa = (struct sockaddr *)(rtm + 1); if (addr_net(dst, &net) < 0 || addr_ntos(&net, sa) < 0) return (-1); sa = NEXTSA(sa); /* Gateway */ if (gw != NULL && type != RTM_GET) { rtm->rtm_flags |= RTF_GATEWAY; rtm->rtm_addrs |= RTA_GATEWAY; if (addr_ntos(gw, sa) < 0) return (-1); sa = NEXTSA(sa); } /* Netmask */ if (dst->addr_ip == IP_ADDR_ANY || dst->addr_bits < IP_ADDR_BITS) { rtm->rtm_addrs |= RTA_NETMASK; if (addr_btos(dst->addr_bits, sa) < 0) return (-1); sa = NEXTSA(sa); } else rtm->rtm_flags |= RTF_HOST; rtm->rtm_msglen = (u_char *)sa - buf; #ifdef DEBUG route_msg_print(rtm); #endif #ifdef HAVE_STREAMS_ROUTE if (ioctl(r->fd, RTSTR_SEND, rtm) < 0) return (-1); #else if (write(r->fd, buf, rtm->rtm_msglen) < 0) return (-1); pid = getpid(); while (type == RTM_GET && (len = read(r->fd, buf, sizeof(buf))) > 0) { if (len < (int)sizeof(*rtm)) { return (-1); } if (rtm->rtm_type == type && rtm->rtm_pid == pid && rtm->rtm_seq == r->seq) { if (rtm->rtm_errno) { errno = rtm->rtm_errno; return (-1); } break; } } #endif if (type == RTM_GET && (rtm->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) { sa = (struct sockaddr *)(rtm + 1); sa = NEXTSA(sa); if (addr_ston(sa, gw) < 0 || gw->addr_type != ADDR_TYPE_IP) { errno = ESRCH; return (-1); } } return (0); } route_t * route_open(void) { route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { r->fd = -1; #ifdef HAVE_STREAMS_MIB2 if ((r->ip_fd = open(IP_DEV_NAME, O_RDWR)) < 0) return (route_close(r)); #endif #ifdef HAVE_STREAMS_ROUTE if ((r->fd = open("/dev/route", O_RDWR, 0)) < 0) #else if ((r->fd = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) #endif return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct route_entry rtent; memcpy(&rtent, entry, sizeof(rtent)); if (route_msg(r, RTM_ADD, &rtent.route_dst, &rtent.route_gw) < 0) return (-1); return (0); } int route_delete(route_t *r, const struct route_entry *entry) { struct route_entry rtent; memcpy(&rtent, entry, sizeof(rtent)); if (route_get(r, &rtent) < 0) return (-1); if (route_msg(r, RTM_DELETE, &rtent.route_dst, &rtent.route_gw) < 0) return (-1); return (0); } int route_get(route_t *r, struct route_entry *entry) { if (route_msg(r, RTM_GET, &entry->route_dst, &entry->route_gw) < 0) return (-1); return (0); } #if defined(HAVE_SYS_SYSCTL_H) || defined(HAVE_STREAMS_ROUTE) int route_loop(route_t *r, route_handler callback, void *arg) { struct rt_msghdr *rtm; struct route_entry entry; struct sockaddr *sa; char *buf, *lim, *next; int ret; #ifdef HAVE_SYS_SYSCTL_H int mib[6] = { CTL_NET, PF_ROUTE, 0, 0 /* XXX */, NET_RT_DUMP, 0 }; size_t len; if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) return (-1); if (len == 0) return (0); if ((buf = malloc(len)) == NULL) return (-1); if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { free(buf); return (-1); } lim = buf + len; next = buf; #else /* HAVE_STREAMS_ROUTE */ struct rt_giarg giarg, *gp; memset(&giarg, 0, sizeof(giarg)); giarg.gi_op = KINFO_RT_DUMP; if (ioctl(r->fd, RTSTR_GETROUTE, &giarg) < 0) return (-1); if ((buf = malloc(giarg.gi_size)) == NULL) return (-1); gp = (struct rt_giarg *)buf; gp->gi_size = giarg.gi_size; gp->gi_op = KINFO_RT_DUMP; gp->gi_where = buf; gp->gi_arg = RTF_UP | RTF_GATEWAY; if (ioctl(r->fd, RTSTR_GETROUTE, buf) < 0) { free(buf); return (-1); } lim = buf + gp->gi_size; next = buf + sizeof(giarg); #endif for (ret = 0; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; sa = (struct sockaddr *)(rtm + 1); if (addr_ston(sa, &entry.route_dst) < 0 || (rtm->rtm_addrs & RTA_GATEWAY) == 0) continue; sa = NEXTSA(sa); if (addr_ston(sa, &entry.route_gw) < 0) continue; if (entry.route_dst.addr_type != entry.route_gw.addr_type || (entry.route_dst.addr_type != ADDR_TYPE_IP && entry.route_dst.addr_type != ADDR_TYPE_IP6)) continue; if (rtm->rtm_addrs & RTA_NETMASK) { sa = NEXTSA(sa); if (addr_stob(sa, &entry.route_dst.addr_bits) < 0) continue; } if ((ret = callback(&entry, arg)) != 0) break; } free(buf); return (ret); } #elif defined(HAVE_STREAMS_MIB2) #ifdef IRE_DEFAULT /* This means Solaris 5.6 */ /* I'm not sure if they are compatible, though -- masaki */ #define IRE_ROUTE IRE_CACHE #define IRE_ROUTE_REDIRECT IRE_HOST_REDIRECT #endif /* IRE_DEFAULT */ int route_loop(route_t *r, route_handler callback, void *arg) { struct route_entry entry; struct sockaddr_in sin; struct strbuf msg; struct T_optmgmt_req *tor; struct T_optmgmt_ack *toa; struct T_error_ack *tea; struct opthdr *opt; mib2_ipRouteEntry_t *rt, *rtend; u_char buf[8192]; int flags, rc, rtable, ret; tor = (struct T_optmgmt_req *)buf; toa = (struct T_optmgmt_ack *)buf; tea = (struct T_error_ack *)buf; tor->PRIM_type = T_OPTMGMT_REQ; tor->OPT_offset = sizeof(*tor); tor->OPT_length = sizeof(*opt); tor->MGMT_flags = T_CURRENT; opt = (struct opthdr *)(tor + 1); opt->level = MIB2_IP; opt->name = opt->len = 0; msg.maxlen = sizeof(buf); msg.len = sizeof(*tor) + sizeof(*opt); msg.buf = buf; if (putmsg(r->ip_fd, &msg, NULL, 0) < 0) return (-1); opt = (struct opthdr *)(toa + 1); msg.maxlen = sizeof(buf); for (;;) { flags = 0; if ((rc = getmsg(r->ip_fd, &msg, NULL, &flags)) < 0) return (-1); /* See if we're finished. */ if (rc == 0 && msg.len >= sizeof(*toa) && toa->PRIM_type == T_OPTMGMT_ACK && toa->MGMT_flags == T_SUCCESS && opt->len == 0) break; if (msg.len >= sizeof(*tea) && tea->PRIM_type == T_ERROR_ACK) return (-1); if (rc != MOREDATA || msg.len < (int)sizeof(*toa) || toa->PRIM_type != T_OPTMGMT_ACK || toa->MGMT_flags != T_SUCCESS) return (-1); rtable = (opt->level == MIB2_IP && opt->name == MIB2_IP_21); msg.maxlen = sizeof(buf) - (sizeof(buf) % sizeof(*rt)); msg.len = 0; flags = 0; do { rc = getmsg(r->ip_fd, NULL, &msg, &flags); if (rc != 0 && rc != MOREDATA) return (-1); if (!rtable) continue; rt = (mib2_ipRouteEntry_t *)msg.buf; rtend = (mib2_ipRouteEntry_t *)(msg.buf + msg.len); sin.sin_family = AF_INET; for ( ; rt < rtend; rt++) { if ((rt->ipRouteInfo.re_ire_type & (IRE_BROADCAST|IRE_ROUTE_REDIRECT| IRE_LOCAL|IRE_ROUTE)) != 0 || rt->ipRouteNextHop == IP_ADDR_ANY) continue; sin.sin_addr.s_addr = rt->ipRouteNextHop; addr_ston((struct sockaddr *)&sin, &entry.route_gw); sin.sin_addr.s_addr = rt->ipRouteDest; addr_ston((struct sockaddr *)&sin, &entry.route_dst); sin.sin_addr.s_addr = rt->ipRouteMask; addr_stob((struct sockaddr *)&sin, &entry.route_dst.addr_bits); if ((ret = callback(&entry, arg)) != 0) return (ret); } } while (rc == MOREDATA); } return (0); } #elif defined(HAVE_NET_RADIX_H) /* XXX - Tru64, others? */ #include static int _kread(int fd, void *addr, void *buf, int len) { if (lseek(fd, (off_t)addr, SEEK_SET) == (off_t)-1L) return (-1); return (read(fd, buf, len) == len ? 0 : -1); } static int _radix_walk(int fd, struct radix_node *rn, route_handler callback, void *arg) { struct radix_node rnode; struct rtentry rt; struct sockaddr_in sin; struct route_entry entry; int ret = 0; again: _kread(fd, rn, &rnode, sizeof(rnode)); if (rnode.rn_b < 0) { if (!(rnode.rn_flags & RNF_ROOT)) { _kread(fd, rn, &rt, sizeof(rt)); _kread(fd, rt_key(&rt), &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.route_dst); if (!(rt.rt_flags & RTF_HOST)) { _kread(fd, rt_mask(&rt), &sin, sizeof(sin)); addr_stob((struct sockaddr *)&sin, &entry.route_dst.addr_bits); } _kread(fd, rt.rt_gateway, &sin, sizeof(sin)); addr_ston((struct sockaddr *)&sin, &entry.route_gw); if ((ret = callback(&entry, arg)) != 0) return (ret); } if ((rn = rnode.rn_dupedkey)) goto again; } else { rn = rnode.rn_r; if ((ret = _radix_walk(fd, rnode.rn_l, callback, arg)) != 0) return (ret); if ((ret = _radix_walk(fd, rn, callback, arg)) != 0) return (ret); } return (ret); } int route_loop(route_t *r, route_handler callback, void *arg) { struct radix_node_head *rnh, head; struct nlist nl[2]; int fd, ret = 0; memset(nl, 0, sizeof(nl)); nl[0].n_name = "radix_node_head"; if (knlist(nl) < 0 || nl[0].n_type == 0 || (fd = open("/dev/kmem", O_RDONLY, 0)) < 0) return (-1); for (_kread(fd, (void *)nl[0].n_value, &rnh, sizeof(rnh)); rnh != NULL; rnh = head.rnh_next) { _kread(fd, rnh, &head, sizeof(head)); /* XXX - only IPv4 for now... */ if (head.rnh_af == AF_INET) { if ((ret = _radix_walk(fd, head.rnh_treetop, callback, arg)) != 0) break; } } close(fd); return (ret); } #else int route_loop(route_t *r, route_handler callback, void *arg) { errno = ENOSYS; return (-1); } #endif route_t * route_close(route_t *r) { if (r != NULL) { #ifdef HAVE_STREAMS_MIB2 if (r->ip_fd >= 0) close(r->ip_fd); #endif if (r->fd >= 0) close(r->fd); free(r); } return (NULL); } libdnet-1.12/trunk/src/route-hpux.c0000644000076500007650000000731510001145373020444 0ustar dugsongdugsong00000000000000/* * route-hpux.c * * Copyright (c) 2000 Dug Song * * $Id: route-hpux.c 483 2004-01-14 04:52:11Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define ADDR_ISHOST(a) (((a)->addr_type == ADDR_TYPE_IP && \ (a)->addr_bits == IP_ADDR_BITS) || \ ((a)->addr_type == ADDR_TYPE_IP6 && \ (a)->addr_bits == IP6_ADDR_BITS)) struct route_handle { int fd; }; route_t * route_open(void) { route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { if ((r->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_ntos(&entry->route_gw, &rt.rt_gateway) < 0 || addr_btom(entry->route_dst.addr_bits, &rt.rt_subnetmask, IP_ADDR_LEN) < 0) return (-1); return (ioctl(r->fd, SIOCADDRT, &rt)); } int route_delete(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_btom(entry->route_dst.addr_bits, &rt.rt_subnetmask, IP_ADDR_LEN) < 0) return (-1); return (ioctl(r->fd, SIOCDELRT, &rt)); } int route_get(route_t *r, struct route_entry *entry) { struct rtreq rtr; memset(&rtr, 0, sizeof(rtr)); /* XXX - gross hack for default route */ if (entry->route_dst.addr_ip == IP_ADDR_ANY) { rtr.rtr_destaddr = htonl(0x60060606); rtr.rtr_subnetmask = 0xffffffff; } else { memcpy(&rtr.rtr_destaddr, &entry->route_dst.addr_ip, IP_ADDR_LEN); if (entry->route_dst.addr_bits < IP_ADDR_BITS) addr_btom(entry->route_dst.addr_bits, &rtr.rtr_subnetmask, IP_ADDR_LEN); } if (ioctl(r->fd, SIOCGRTENTRY, &rtr) < 0) return (-1); if (rtr.rtr_gwayaddr == 0) { errno = ESRCH; return (-1); } entry->route_gw.addr_type = ADDR_TYPE_IP; entry->route_gw.addr_bits = IP_ADDR_BITS; memcpy(&entry->route_gw.addr_ip, &rtr.rtr_gwayaddr, IP_ADDR_LEN); return (0); } #define MAX_RTENTRIES 256 /* XXX */ int route_loop(route_t *r, route_handler callback, void *arg) { struct nmparms nm; struct route_entry entry; mib_ipRouteEnt rtentries[MAX_RTENTRIES]; int fd, i, n, ret; if ((fd = open_mib("/dev/ip", O_RDWR, 0 /* XXX */, 0)) < 0) return (-1); nm.objid = ID_ipRouteTable; nm.buffer = rtentries; n = sizeof(rtentries); nm.len = &n; if (get_mib_info(fd, &nm) < 0) { close_mib(fd); return (-1); } close_mib(fd); entry.route_dst.addr_type = entry.route_gw.addr_type = ADDR_TYPE_IP; entry.route_dst.addr_bits = entry.route_gw.addr_bits = IP_ADDR_BITS; n /= sizeof(*rtentries); ret = 0; for (i = 0; i < n; i++) { if (rtentries[i].Type != NMDIRECT && rtentries[i].Type != NMREMOTE) continue; entry.route_dst.addr_ip = rtentries[i].Dest; addr_mtob(&rtentries[i].Mask, IP_ADDR_LEN, &entry.route_dst.addr_bits); entry.route_gw.addr_ip = rtentries[i].NextHop; if ((ret = callback(&entry, arg)) != 0) break; } return (ret); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->fd >= 0) close(r->fd); free(r); } return (NULL); } libdnet-1.12/trunk/src/route-linux.c0000644000076500007650000001437110362375311020626 0ustar dugsongdugsong00000000000000/* * route-linux.c * * Copyright (c) 2000 Dug Song * * $Id: route-linux.c 619 2006-01-15 07:33:29Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define ADDR_ISHOST(a) (((a)->addr_type == ADDR_TYPE_IP && \ (a)->addr_bits == IP_ADDR_BITS) || \ ((a)->addr_type == ADDR_TYPE_IP6 && \ (a)->addr_bits == IP6_ADDR_BITS)) #define PROC_ROUTE_FILE "/proc/net/route" #define PROC_IPV6_ROUTE_FILE "/proc/net/ipv6_route" struct route_handle { int fd; int nlfd; }; route_t * route_open(void) { struct sockaddr_nl snl; route_t *r; if ((r = calloc(1, sizeof(*r))) != NULL) { r->fd = r->nlfd = -1; if ((r->fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return (route_close(r)); if ((r->nlfd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) return (route_close(r)); memset(&snl, 0, sizeof(snl)); snl.nl_family = AF_NETLINK; if (bind(r->nlfd, (struct sockaddr *)&snl, sizeof(snl)) < 0) return (route_close(r)); } return (r); } int route_add(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP | RTF_GATEWAY; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_ntos(&entry->route_gw, &rt.rt_gateway) < 0 || addr_btos(entry->route_dst.addr_bits, &rt.rt_genmask) < 0) return (-1); return (ioctl(r->fd, SIOCADDRT, &rt)); } int route_delete(route_t *r, const struct route_entry *entry) { struct rtentry rt; struct addr dst; memset(&rt, 0, sizeof(rt)); rt.rt_flags = RTF_UP; if (ADDR_ISHOST(&entry->route_dst)) { rt.rt_flags |= RTF_HOST; memcpy(&dst, &entry->route_dst, sizeof(dst)); } else addr_net(&entry->route_dst, &dst); if (addr_ntos(&dst, &rt.rt_dst) < 0 || addr_btos(entry->route_dst.addr_bits, &rt.rt_genmask) < 0) return (-1); return (ioctl(r->fd, SIOCDELRT, &rt)); } int route_get(route_t *r, struct route_entry *entry) { static int seq; struct nlmsghdr *nmsg; struct rtmsg *rmsg; struct rtattr *rta; struct sockaddr_nl snl; struct iovec iov; struct msghdr msg; u_char buf[512]; int i, af, alen; switch (entry->route_dst.addr_type) { case ADDR_TYPE_IP: af = AF_INET; alen = IP_ADDR_LEN; break; case ADDR_TYPE_IP6: af = AF_INET6; alen = IP6_ADDR_LEN; break; default: errno = EINVAL; return (-1); } memset(buf, 0, sizeof(buf)); nmsg = (struct nlmsghdr *)buf; nmsg->nlmsg_len = NLMSG_LENGTH(sizeof(*nmsg)) + RTA_LENGTH(alen); nmsg->nlmsg_flags = NLM_F_REQUEST; nmsg->nlmsg_type = RTM_GETROUTE; nmsg->nlmsg_seq = ++seq; rmsg = (struct rtmsg *)(nmsg + 1); rmsg->rtm_family = af; rmsg->rtm_dst_len = entry->route_dst.addr_bits; rta = RTM_RTA(rmsg); rta->rta_type = RTA_DST; rta->rta_len = RTA_LENGTH(alen); /* XXX - gross hack for default route */ if (af == AF_INET && entry->route_dst.addr_ip == IP_ADDR_ANY) { i = htonl(0x60060606); memcpy(RTA_DATA(rta), &i, alen); } else memcpy(RTA_DATA(rta), entry->route_dst.addr_data8, alen); memset(&snl, 0, sizeof(snl)); snl.nl_family = AF_NETLINK; iov.iov_base = nmsg; iov.iov_len = nmsg->nlmsg_len; memset(&msg, 0, sizeof(msg)); msg.msg_name = &snl; msg.msg_namelen = sizeof(snl); msg.msg_iov = &iov; msg.msg_iovlen = 1; if (sendmsg(r->nlfd, &msg, 0) < 0) return (-1); iov.iov_base = buf; iov.iov_len = sizeof(buf); if ((i = recvmsg(r->nlfd, &msg, 0)) <= 0) return (-1); if (nmsg->nlmsg_len < (int)sizeof(*nmsg) || nmsg->nlmsg_len > i || nmsg->nlmsg_seq != seq) { errno = EINVAL; return (-1); } if (nmsg->nlmsg_type == NLMSG_ERROR) return (-1); i -= NLMSG_LENGTH(sizeof(*nmsg)); while (RTA_OK(rta, i)) { if (rta->rta_type == RTA_GATEWAY) { entry->route_gw.addr_type = entry->route_dst.addr_type; memcpy(entry->route_gw.addr_data8, RTA_DATA(rta), alen); entry->route_gw.addr_bits = alen * 8; return (0); } rta = RTA_NEXT(rta, i); } errno = ESRCH; return (-1); } int route_loop(route_t *r, route_handler callback, void *arg) { FILE *fp; struct route_entry entry; char buf[BUFSIZ]; int ret = 0; if ((fp = fopen(PROC_ROUTE_FILE, "r")) != NULL) { char ifbuf[16]; int i, iflags, refcnt, use, metric, mss, win, irtt; uint32_t mask; while (fgets(buf, sizeof(buf), fp) != NULL) { i = sscanf(buf, "%16s %X %X %X %d %d %d %X %d %d %d\n", ifbuf, &entry.route_dst.addr_ip, &entry.route_gw.addr_ip, &iflags, &refcnt, &use, &metric, &mask, &mss, &win, &irtt); if (i < 10 || !(iflags & RTF_UP)) continue; if (entry.route_gw.addr_ip == IP_ADDR_ANY) continue; entry.route_dst.addr_type = entry.route_gw.addr_type = ADDR_TYPE_IP; if (addr_mtob(&mask, IP_ADDR_LEN, &entry.route_dst.addr_bits) < 0) continue; entry.route_gw.addr_bits = IP_ADDR_BITS; if ((ret = callback(&entry, arg)) != 0) break; } fclose(fp); } if (ret == 0 && (fp = fopen(PROC_IPV6_ROUTE_FILE, "r")) != NULL) { char s[33], d[8][5], n[8][5]; u_int slen, dlen; while (fgets(buf, sizeof(buf), fp) != NULL) { sscanf(buf, "%04s%04s%04s%04s%04s%04s%04s%04s %02x " "%32s %02x %04s%04s%04s%04s%04s%04s%04s%04s ", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], &dlen, s, &slen, n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7]); snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], dlen); addr_aton(buf, &entry.route_dst); snprintf(buf, sizeof(buf), "%s:%s:%s:%s:%s:%s:%s:%s/%d", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7], IP6_ADDR_BITS); addr_aton(buf, &entry.route_gw); if ((ret = callback(&entry, arg)) != 0) break; } fclose(fp); } return (ret); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->fd >= 0) close(r->fd); if (r->nlfd >= 0) close(r->nlfd); free(r); } return (NULL); } libdnet-1.12/trunk/src/route-none.c0000644000076500007650000000137007427404041020422 0ustar dugsongdugsong00000000000000/* * route-none.c * * Copyright (c) 2000 Dug Song * * $Id: route-none.c 260 2002-02-04 04:03:45Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" route_t * route_open(void) { errno = ENOSYS; return (NULL); } int route_add(route_t *r, const struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_delete(route_t *r, const struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_get(route_t *r, struct route_entry *entry) { errno = ENOSYS; return (-1); } int route_loop(route_t *r, route_handler callback, void *arg) { errno = ENOSYS; return (-1); } route_t * route_close(route_t *r) { return (NULL); } libdnet-1.12/trunk/src/route-win32.c0000644000076500007650000000666110204320244020422 0ustar dugsongdugsong00000000000000/* * route-win32.c * * Copyright (c) 2002 Dug Song * * $Id: route-win32.c 589 2005-02-15 07:11:32Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" struct route_handle { MIB_IPFORWARDTABLE *ipftable; }; route_t * route_open(void) { return (calloc(1, sizeof(route_t))); } int route_add(route_t *route, const struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; struct addr net; memset(&ipfrow, 0, sizeof(ipfrow)); if (GetBestInterface(entry->route_gw.addr_ip, &ipfrow.dwForwardIfIndex) != NO_ERROR) return (-1); if (addr_net(&entry->route_dst, &net) < 0 || net.addr_type != ADDR_TYPE_IP) return (-1); ipfrow.dwForwardDest = net.addr_ip; addr_btom(entry->route_dst.addr_bits, &ipfrow.dwForwardMask, IP_ADDR_LEN); ipfrow.dwForwardNextHop = entry->route_gw.addr_ip; ipfrow.dwForwardType = 4; /* XXX - next hop != final dest */ ipfrow.dwForwardProto = 3; /* XXX - MIB_PROTO_NETMGMT */ if (CreateIpForwardEntry(&ipfrow) != NO_ERROR) return (-1); return (0); } int route_delete(route_t *route, const struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; DWORD mask; if (entry->route_dst.addr_type != ADDR_TYPE_IP || GetBestRoute(entry->route_dst.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); addr_btom(entry->route_dst.addr_bits, &mask, IP_ADDR_LEN); if (ipfrow.dwForwardDest != entry->route_dst.addr_ip || ipfrow.dwForwardMask != mask) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } if (DeleteIpForwardEntry(&ipfrow) != NO_ERROR) return (-1); return (0); } int route_get(route_t *route, struct route_entry *entry) { MIB_IPFORWARDROW ipfrow; DWORD mask; if (entry->route_dst.addr_type != ADDR_TYPE_IP || GetBestRoute(entry->route_dst.addr_ip, IP_ADDR_ANY, &ipfrow) != NO_ERROR) return (-1); if (ipfrow.dwForwardProto == 2 && /* XXX - MIB_IPPROTO_LOCAL */ (ipfrow.dwForwardNextHop|IP_CLASSA_NET) != (IP_ADDR_LOOPBACK|IP_CLASSA_NET) && !IP_LOCAL_GROUP(ipfrow.dwForwardNextHop)) { errno = ENXIO; SetLastError(ERROR_NO_DATA); return (-1); } addr_btom(entry->route_dst.addr_bits, &mask, IP_ADDR_LEN); entry->route_gw.addr_type = ADDR_TYPE_IP; entry->route_gw.addr_bits = IP_ADDR_BITS; entry->route_gw.addr_ip = ipfrow.dwForwardNextHop; return (0); } int route_loop(route_t *r, route_handler callback, void *arg) { struct route_entry entry; ULONG len; int i, ret; for (len = sizeof(r->ipftable[0]); ; ) { if (r->ipftable) free(r->ipftable); r->ipftable = malloc(len); ret = GetIpForwardTable(r->ipftable, &len, FALSE); if (ret == NO_ERROR) break; else if (ret != ERROR_INSUFFICIENT_BUFFER) return (-1); } entry.route_dst.addr_type = ADDR_TYPE_IP; entry.route_dst.addr_bits = IP_ADDR_BITS; entry.route_gw.addr_type = ADDR_TYPE_IP; entry.route_gw.addr_bits = IP_ADDR_BITS; for (i = 0; i < (int)r->ipftable->dwNumEntries; i++) { entry.route_dst.addr_ip = r->ipftable->table[i].dwForwardDest; addr_mtob(&r->ipftable->table[i].dwForwardMask, IP_ADDR_LEN, &entry.route_dst.addr_bits); entry.route_gw.addr_ip = r->ipftable->table[i].dwForwardNextHop; if ((ret = (*callback)(&entry, arg)) != 0) return (ret); } return (0); } route_t * route_close(route_t *r) { if (r != NULL) { if (r->ipftable != NULL) free(r->ipftable); free(r); } return (NULL); } libdnet-1.12/trunk/src/strlcat.c0000644000076500007650000000501707361216262020010 0ustar dugsongdugsong00000000000000/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz <= strlen(dst)). * Returns strlen(src) + MIN(siz, strlen(initial dst)). * If retval >= siz, truncation occurred. */ size_t strlcat(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } libdnet-1.12/trunk/src/strlcpy.c0000644000076500007650000000464007361216262020035 0ustar dugsongdugsong00000000000000/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } libdnet-1.12/trunk/src/strsep.c0000644000076500007650000000576407776646375017713 0ustar dugsongdugsong00000000000000/* $OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; #else static char *rcsid = "$OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char * strsep(stringp, delim) register char **stringp; register const char *delim; { register char *s; register const char *spanp; register int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } libdnet-1.12/trunk/src/tun-bsd.c0000644000076500007650000000537010202771454017707 0ustar dugsongdugsong00000000000000/* * tun-bsd.c * * Copyright (c) 2001 Dug Song * * $Id: tun-bsd.c 573 2005-02-10 23:50:04Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include "dnet.h" struct tun { int fd; intf_t *intf; struct intf_entry save; }; #define MAX_DEVS 16 /* XXX - max number of tunnel devices */ tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { struct intf_entry ifent; tun_t *tun; char dev[128]; int i; if (src->addr_type != ADDR_TYPE_IP || dst->addr_type != ADDR_TYPE_IP || src->addr_bits != IP_ADDR_BITS || dst->addr_bits != IP_ADDR_BITS) { errno = EINVAL; return (NULL); } if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); if ((tun->intf = intf_open()) == NULL) return (tun_close(tun)); memset(&ifent, 0, sizeof(ifent)); ifent.intf_len = sizeof(ifent); for (i = 0; i < MAX_DEVS; i++) { snprintf(dev, sizeof(dev), "/dev/tun%d", i); strlcpy(ifent.intf_name, dev + 5, sizeof(ifent.intf_name)); tun->save = ifent; if ((tun->fd = open(dev, O_RDWR, 0)) != -1 && intf_get(tun->intf, &tun->save) == 0) { route_t *r; struct route_entry entry; ifent.intf_flags = INTF_FLAG_UP|INTF_FLAG_POINTOPOINT; ifent.intf_addr = *src; ifent.intf_dst_addr = *dst; ifent.intf_mtu = mtu; if (intf_set(tun->intf, &ifent) < 0) tun = tun_close(tun); /* XXX - try to ensure our route got set */ if ((r = route_open()) != NULL) { entry.route_dst = *dst; entry.route_gw = *src; route_add(r, &entry); route_close(r); } break; } } if (i == MAX_DEVS) tun = tun_close(tun); return (tun); } const char * tun_name(tun_t *tun) { return (tun->save.intf_name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { #ifdef __OpenBSD__ struct iovec iov[2]; uint32_t af = htonl(AF_INET); iov[0].iov_base = ⁡ iov[0].iov_len = sizeof(af); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (writev(tun->fd, iov, 2)); #else return (write(tun->fd, buf, size)); #endif } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { #ifdef __OpenBSD__ struct iovec iov[2]; uint32_t af; iov[0].iov_base = ⁡ iov[0].iov_len = sizeof(af); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (readv(tun->fd, iov, 2) - sizeof(af)); #else return (read(tun->fd, buf, size)); #endif } tun_t * tun_close(tun_t *tun) { if (tun->fd > 0) close(tun->fd); if (tun->intf != NULL) { /* Restore interface configuration on close. */ intf_set(tun->intf, &tun->save); intf_close(tun->intf); } free(tun); return (NULL); } libdnet-1.12/trunk/src/tun-linux.c0000644000076500007650000000404710311162536020272 0ustar dugsongdugsong00000000000000/* * tun-linux.c * * Universal TUN/TAP driver, in Linux 2.4+ * /usr/src/linux/Documentation/networking/tuntap.txt * * Copyright (c) 2001 Dug Song * * $Id: tun-linux.c 612 2005-09-12 02:18:06Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "dnet.h" struct tun { int fd; intf_t *intf; struct ifreq ifr; }; tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { tun_t *tun; struct intf_entry ifent; if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); if ((tun->fd = open("/dev/net/tun", O_RDWR, 0)) < 0 || (tun->intf = intf_open()) == NULL) return (tun_close(tun)); tun->ifr.ifr_flags = IFF_TUN; if (ioctl(tun->fd, TUNSETIFF, (void *) &tun->ifr) < 0) return (tun_close(tun)); memset(&ifent, 0, sizeof(ifent)); strlcpy(ifent.intf_name, tun->ifr.ifr_name, sizeof(ifent.intf_name)); ifent.intf_flags = INTF_FLAG_UP|INTF_FLAG_POINTOPOINT; ifent.intf_addr = *src; ifent.intf_dst_addr = *dst; ifent.intf_mtu = mtu; if (intf_set(tun->intf, &ifent) < 0) return (tun_close(tun)); return (tun); } const char * tun_name(tun_t *tun) { return (tun->ifr.ifr_name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { struct iovec iov[2]; uint32_t type = ETH_TYPE_IP; iov[0].iov_base = &type; iov[0].iov_len = sizeof(type); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (writev(tun->fd, iov, 2)); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { struct iovec iov[2]; uint32_t type; iov[0].iov_base = &type; iov[0].iov_len = sizeof(type); iov[1].iov_base = (void *)buf; iov[1].iov_len = size; return (readv(tun->fd, iov, 2) - sizeof(type)); } tun_t * tun_close(tun_t *tun) { if (tun->fd > 0) close(tun->fd); if (tun->intf != NULL) intf_close(tun->intf); free(tun); return (NULL); } libdnet-1.12/trunk/src/tun-none.c0000644000076500007650000000132610177074125020075 0ustar dugsongdugsong00000000000000/* * tun-none.c * * Copyright (c) 2001 Dug Song * * $Id: tun-none.c 548 2005-01-30 06:01:57Z dugsong $ */ #include "config.h" #include #include #include #include #include "dnet.h" tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { errno = ENOSYS; return (NULL); } const char * tun_name(tun_t *tun) { errno = ENOSYS; return (NULL); } int tun_fileno(tun_t *tun) { errno = ENOSYS; return (-1); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { errno = ENOSYS; return (-1); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { errno = ENOSYS; return (-1); } tun_t * tun_close(tun_t *tun) { return (NULL); } libdnet-1.12/trunk/src/tun-solaris.c0000644000076500007650000000431610175535200020606 0ustar dugsongdugsong00000000000000/* * tun-solaris.c * * Universal TUN/TAP driver * * Copyright (c) 2001 Dug Song * * $Id: tun-solaris.c 547 2005-01-25 21:30:40Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "dnet.h" #define DEV_TUN "/dev/tun" #define DEV_IP "/dev/ip" struct tun { int fd; int ip_fd; int if_fd; char name[16]; }; tun_t * tun_open(struct addr *src, struct addr *dst, int mtu) { tun_t *tun; char cmd[512]; int ppa; if ((tun = calloc(1, sizeof(*tun))) == NULL) return (NULL); tun->fd = tun->ip_fd = tun->if_fd = -1; if ((tun->fd = open(DEV_TUN, O_RDWR, 0)) < 0) return (tun_close(tun)); if ((tun->ip_fd = open(DEV_IP, O_RDWR, 0)) < 0) return (tun_close(tun)); if ((ppa = ioctl(tun->fd, TUNNEWPPA, ppa)) < 0) return (tun_close(tun)); if ((tun->if_fd = open(DEV_TUN, O_RDWR, 0)) < 0) return (tun_close(tun)); if (ioctl(tun->if_fd, I_PUSH, "ip") < 0) return (tun_close(tun)); if (ioctl(tun->if_fd, IF_UNITSEL, (char *)&ppa) < 0) return (tun_close(tun)); if (ioctl(tun->ip_fd, I_LINK, tun->if_fd) < 0) return (tun_close(tun)); snprintf(tun->name, sizeof(tun->name), "tun%d", ppa); snprintf(cmd, sizeof(cmd), "ifconfig %s %s/32 %s mtu %d up", tun->name, addr_ntoa(src), addr_ntoa(dst), mtu); if (system(cmd) < 0) return (tun_close(tun)); return (tun); } const char * tun_name(tun_t *tun) { return (tun->name); } int tun_fileno(tun_t *tun) { return (tun->fd); } ssize_t tun_send(tun_t *tun, const void *buf, size_t size) { struct strbuf sbuf; sbuf.buf = buf; sbuf.len = size; return (putmsg(tun->fd, NULL, &sbuf, 0) >= 0 ? sbuf.len : -1); } ssize_t tun_recv(tun_t *tun, void *buf, size_t size) { struct strbuf sbuf; int flags = 0; sbuf.buf = buf; sbuf.maxlen = size; return (getmsg(tun->fd, NULL, &sbuf, &flags) >= 0 ? sbuf.len : -1); } tun_t * tun_close(tun_t *tun) { if (tun->if_fd >= 0) close(tun->if_fd); if (tun->ip_fd >= 0) close(tun->ip_fd); if (tun->fd >= 0) close(tun->fd); free(tun); return (NULL); } libdnet-1.12/trunk/test/0000755000076500007650000000000010554406415016354 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/test/check/0000755000076500007650000000000010554406417017433 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/test/check/check_addr.c0000644000076500007650000002343110363372615021651 0ustar dugsongdugsong00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #define ADDR_PACK(a, ip) \ (a)->addr_type = ADDR_TYPE_IP; \ (a)->addr_bits = IP_ADDR_BITS; \ (a)->addr_ip = (ip) #ifdef HAVE_SOCKADDR_SA_LEN #define SIN_PACK(s, ip, port) \ (s)->sin_len = sizeof(struct sockaddr_in); \ (s)->sin_family = AF_INET; \ (s)->sin_port = htons(port); \ (s)->sin_addr.s_addr = (ip) #else #define SIN_PACK(s, ip, port) \ (s)->sin_family = AF_INET; \ (s)->sin_port = htons(port); \ (s)->sin_addr.s_addr = (ip) #endif typedef struct sockaddr SA; START_TEST(test_addr_pack) { struct addr a, b; memset(&a, 0, sizeof(a)); memset(&b, 0, sizeof(b)); ADDR_PACK(&a, 666); addr_pack(&b, ADDR_TYPE_IP, IP_ADDR_BITS, &a.addr_ip, IP_ADDR_LEN); fail_unless(memcmp(&a, &b, sizeof(a)) == 0, "got different address"); } END_TEST START_TEST(test_addr_cmp) { struct addr a, b; ADDR_PACK(&a, 666); memcpy(&b, &a, sizeof(a)); fail_unless(addr_cmp(&a, &b) == 0, "failed on equal addresses"); b.addr_type = ADDR_TYPE_ETH; fail_unless(addr_cmp(&a, &b) != 0, "failed on different addr_type"); memcpy(&b, &a, sizeof(a)); b.addr_bits--; fail_unless(addr_cmp(&a, &b) > 0, "failed on lesser addr_bits"); memcpy(&b, &a, sizeof(a)); b.addr_ip--; fail_unless(addr_cmp(&a, &b) != 0, "failed on different addr_ip"); addr_aton("10.0.0.1", &a); addr_aton("10.0.0.2", &b); fail_unless(addr_cmp(&a, &b) < 0, "failed on lesser addr compare"); fail_unless(addr_cmp(&b, &a) > 0, "failed on greater addr compare"); } END_TEST START_TEST(test_addr_bcast) { struct addr a, b; ADDR_PACK(&a, htonl(0x01020304)); a.addr_bits = 29; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x01020307), "wrong for /29"); a.addr_bits = 16; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x0102ffff), "wrong for /16"); a.addr_bits = 5; addr_bcast(&a, &b); fail_unless(b.addr_ip == htonl(0x7ffffff), "wrong for /5"); } END_TEST START_TEST(test_addr_net) { struct addr a, b; ADDR_PACK(&a, htonl(0x01020304)); a.addr_bits = 24; addr_net(&a, &b); fail_unless(b.addr_ip == htonl(0x01020300), "wrong for /24"); addr_aton("cafe:babe::dead:beef", &a); a.addr_bits = 20; addr_net(&a, &b); addr_aton("cafe:b000::", &a); a.addr_bits = IP6_ADDR_BITS; fail_unless(addr_cmp(&a, &b) == 0, "IPv6 net failed"); } END_TEST START_TEST(test_addr_ntop) { struct ntop { u_char *n; char *p; } *ntop, ntop_ip6[] = { { IP6_ADDR_UNSPEC, "::" }, { IP6_ADDR_LOOPBACK, "::1" }, { "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01", "fe08::1" }, { "\xff\xff\xff\xff\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" }, { "\xca\xfe\xba\xbe\x00\x00\x00\x00\x00\x00\x00\x00" "\xde\xad\xbe\xef", "cafe:babe::dead:beef" }, { "\xfe\xed\xfa\xce\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00", "feed:face::" }, { "\x00\x00\x00\x0a\x00\x0b\x00\x0c\x00" "\x0d\x00\x0e\x00\x0f\x00\x00", "0:a:b:c:d:e:f:0" }, { "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\xff\xff\x01\x02\x03\x04", "::ffff:1.2.3.4" }, { NULL } }; struct addr a; char buf[64]; ADDR_PACK(&a, htonl(0x010203ff)); a.addr_bits = 23; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255/23") == 0, "bad /23 handling"); a.addr_bits = 0; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255/0") == 0, "bad /0 handling"); a.addr_bits = 32; addr_ntop(&a, buf, sizeof(buf)); fail_unless(strcmp(buf, "1.2.3.255") == 0, "bad /32 handling"); fail_unless(addr_ntop(&a, buf, 9) == NULL, "buffer overflow?"); addr_pack(&a, ADDR_TYPE_ETH, ETH_ADDR_BITS, "\x00\x00\x00\x00\x00\x00", ETH_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), "00:00:00:00:00:00") == 0, "bad empty MAC handling"); memcpy(&a.addr_eth, "\x00\x0d\x0e\x0a\x0d\x00", ETH_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), "00:0d:0e:0a:0d:00") == 0, "b0rked"); a.addr_bits = 16; fail_unless(addr_ntop(&a, buf, sizeof(buf)) == NULL, "took /16 mask"); for (ntop = ntop_ip6; ntop->n != NULL; ntop++) { addr_pack(&a, ADDR_TYPE_IP6, IP6_ADDR_BITS, ntop->n, IP6_ADDR_LEN); fail_unless(strcmp(addr_ntop(&a, buf, sizeof(buf)), ntop->p) == 0, ntop->p); } } END_TEST START_TEST(test_addr_pton) { struct pton { char *p; u_char *n; } *pton, pton_ip6[] = { { "::", IP6_ADDR_UNSPEC }, { "::1", IP6_ADDR_LOOPBACK }, { "fe08::", "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00" }, { "fe08::1", "\xfe\x08\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01" }, { "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "\xff\xff\xff\xff" "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" }, { "cafe::babe:dead:beef:0:ffff", "\xca\xfe\x00\x00\x00\x00" "\xba\xbe\xde\xad\xbe\xef\x00\x00\xff\xff" }, { "::1.2.3.4", "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x01\x02\x03\x04" }, { ":cafe", NULL }, { ":::", NULL }, { "::fffff", NULL }, { NULL } }, pton_eth[] = { { "0:d:e:a:d:0", "\x00\x0d\x0e\x0a\x0d\x00" }, { "ff:ff:ff:ff:ff:ff", ETH_ADDR_BROADCAST }, { "00:d:0e:a:0d:0", "\x00\x0d\x0e\x0a\x0d\x00" }, { ":d:e:a:d:0", NULL }, { "0:d:e:a:d:", NULL }, { "0:d:e:a:def:0", NULL }, { "0:d:e:a:d:0:0", NULL }, { "0:0:0:0:0:0", "\x00\x00\x00\x00\x00\x00" }, { NULL } }; struct addr a, b; int res; ADDR_PACK(&a, htonl(0x010203ff)); a.addr_bits = 17; addr_pton("1.2.3.255/17", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad /17 handling"); a.addr_bits = 32; addr_pton("1.2.3.255", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad handling of missing /32"); fail_unless(addr_pton("1.2.3.4/33", &b) < 0, "accepted /33"); fail_unless(addr_pton("1.2.3.256", &b) < 0, "accepted .256"); fail_unless(addr_pton("1.2.3.4.5", &b) < 0, "accepted quint octet"); fail_unless(addr_pton("1.2.3", &b) < 0, "accepted triple octet"); fail_unless(addr_pton("localhost", &b) == 0, "barfed on localhost"); fail_unless(addr_pton("localhost/24", &b) == 0, "barfed on localhost/24"); addr_pton("1.2.3.4/24", &a); addr_pton("1.2.3.4/255.255.255.0", &b); fail_unless(addr_cmp(&a, &b) == 0, "bad /255.255.255.0 handling"); for (pton = pton_eth; pton->n != NULL; pton++) { res = addr_pton(pton->p, &a); if (pton->n != NULL) { fail_unless(res == 0 && a.addr_type == ADDR_TYPE_ETH && a.addr_bits == ETH_ADDR_BITS && memcmp(&a.addr_eth, pton->n, ETH_ADDR_LEN) == 0, pton->p); } else { fail_unless(res < 0, pton->p); } } for (pton = pton_ip6; pton->n != NULL; pton++) { res = addr_pton(pton->p, &a); if (pton->n != NULL) { fail_unless(res == 0 && a.addr_type == ADDR_TYPE_IP6 && a.addr_bits == IP6_ADDR_BITS && memcmp(&a.addr_ip6, pton->n, IP6_ADDR_LEN) == 0, pton->p); } else { fail_unless(res < 0, pton->p); } } } END_TEST START_TEST(test_addr_ntoa) { struct addr a; int i; ADDR_PACK(&a, htonl(0x01020304)); for (i = 0; i < 1000; i++) { fail_unless(strcmp(addr_ntoa(&a), "1.2.3.4") == 0, "barfed on 1.2.3.4 loop"); } } END_TEST START_TEST(test_addr_ntos) { struct sockaddr_in s1, s2; struct addr a; memset(&s1, 0, sizeof(s1)); memset(&s2, 0, sizeof(s2)); SIN_PACK(&s1, htonl(0x01020304), 0); ADDR_PACK(&a, htonl(0x01020304)); addr_ntos(&a, (SA *)&s2); fail_unless(memcmp(&s1, &s2, sizeof(s1)) == 0, "bad sockaddr_in"); } END_TEST START_TEST(test_addr_ston) { struct sockaddr_in s, t; struct addr a, b; memset(&a, 0, sizeof(a)); ADDR_PACK(&a, htonl(0x01020304)); memcpy(&b, &a, sizeof(&b)); SIN_PACK(&s, htonl(0x01020304), 0); memcpy(&t, &s, sizeof(&t)); addr_ston((SA *)&s, &b); fail_unless(memcmp(&a, &b, sizeof(a)) == 0, "bad addr"); #ifdef HAVE_SOCKADDR_SA_LEN s.sin_len = 0; fail_unless(addr_ston((SA *)&s, &b) == 0 && addr_cmp(&a, &b) == 0, "sin_len == 0"); #endif s.sin_family = 123; fail_unless(addr_ston((SA *)&s, &b) < 0, "sin_family == 123"); } END_TEST START_TEST(test_addr_btos) { struct sockaddr s; struct addr a; ADDR_PACK(&a, htonl(0xffffff00)); a.addr_bits = 24; fail_unless(addr_btos(a.addr_bits, &s) == 0, "b0rked"); } END_TEST START_TEST(test_addr_stob) { struct sockaddr_in s; struct addr a; SIN_PACK(&s, htonl(0xffffff00), 0); addr_stob((SA *)&s, &a.addr_bits); fail_unless(a.addr_bits == 24, "b0rked"); /* XXX - BSD routing sockets or SIOCGIFNETMASK */ s.sin_family = 0; fail_unless(addr_stob((SA *)&s, &a.addr_bits) == 0 && a.addr_bits == 24, "sin_family = 0"); } END_TEST START_TEST(test_addr_btom) { struct addr a; uint32_t mask; ADDR_PACK(&a, htonl(0xffffff00)); a.addr_bits = 24; addr_btom(a.addr_bits, &mask, sizeof(mask)); fail_unless(mask == htonl(0xffffff00), "b0rked"); } END_TEST START_TEST(test_addr_mtob) { struct addr a; uint32_t mask; mask = htonl(0xffffff00); addr_mtob(&mask, sizeof(mask), &a.addr_bits); fail_unless(a.addr_bits == 24, "b0rked"); } END_TEST Suite * addr_suite(void) { Suite *s = suite_create("addr"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_addr_pack); tcase_add_test(tc_core, test_addr_cmp); tcase_add_test(tc_core, test_addr_bcast); tcase_add_test(tc_core, test_addr_net); tcase_add_test(tc_core, test_addr_ntop); tcase_add_test(tc_core, test_addr_pton); tcase_add_test(tc_core, test_addr_ntoa); tcase_add_test(tc_core, test_addr_ntos); tcase_add_test(tc_core, test_addr_ston); tcase_add_test(tc_core, test_addr_btos); tcase_add_test(tc_core, test_addr_stob); tcase_add_test(tc_core, test_addr_btom); tcase_add_test(tc_core, test_addr_mtob); return (s); } int main(void) { Suite *s = addr_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_arp.c0000644000076500007650000000214110363372615021514 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_arp_pack) { } END_TEST START_TEST(test_arp_openclose) { arp_t *a; fail_unless((a = arp_open()) != NULL, "open failed"); fail_unless((a = arp_close(a)) == NULL, "close failed"); } END_TEST START_TEST(test_arp_add) { } END_TEST START_TEST(test_arp_delete) { } END_TEST START_TEST(test_arp_get) { } END_TEST START_TEST(test_arp_loop) { } END_TEST Suite * arp_suite(void) { Suite *s = suite_create("arp"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_arp_pack); tcase_add_test(tc_core, test_arp_openclose); tcase_add_test(tc_core, test_arp_add); tcase_add_test(tc_core, test_arp_delete); tcase_add_test(tc_core, test_arp_get); tcase_add_test(tc_core, test_arp_loop); return (s); } int main(void) { Suite *s = arp_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_blob.c0000644000076500007650000001043510363372615021655 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_blob_newfree) { blob_t *b; fail_unless((b = blob_new()) != NULL, "new failed"); fail_unless((b = blob_free(b)) == NULL, "free failed"); } END_TEST START_TEST(test_blob_readwrite) { blob_t *b; char tmp[32]; b = blob_new(); blob_write(b, "foobar", 7); blob_write(b, "spazzo", 7); blob_write(b, "doofus", 7); blob_rewind(b); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "foobar") == 0, "read1 failed"); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "spazzo") == 0, "read2 failed"); blob_read(b, tmp, 7); fail_unless(strcmp(tmp, "doofus") == 0, "read3 failed"); blob_free(b); } END_TEST START_TEST(test_blob_insertdelete) { blob_t *b, bf; char tmp[32]; b = blob_new(); fail_unless(blob_insert(b, "foo", 3) == 3, "insert1 failed"); blob_rewind(b); fail_unless(blob_insert(b, "bar", 3) == 3, "insert2 failed"); blob_rewind(b); blob_read(b, tmp, 6); tmp[6] = 0; fail_unless(strcmp(tmp,"barfoo") == 0, "read failed"); blob_rewind(b); fail_unless(blob_delete(b, NULL, 3) == 3, "delete failed"); blob_rewind(b); blob_read(b, tmp, 3); tmp[3] = 0; fail_unless(strcmp(tmp,"foo") == 0, "read failed"); fail_unless(blob_delete(b, NULL, 4) < 0, "deleted more than size"); b = blob_free(b); bf.base = "foobar"; bf.end = 6; bf.off = bf.size = 0; fail_unless(blob_insert(&bf, "foobar", 6) < 0, "inserted into fixed"); fail_unless(blob_delete(&bf, NULL, 3) < 0, "deleted from fixed"); } END_TEST START_TEST(test_blob_packunpack) { blob_t *b; uint32_t D, d; uint16_t H, h; u_char c; char s[128]; u_char buf[6]; b = blob_new(); D = 0xdeadbeef; H = 0xbabe; memcpy(buf, "f\x00\x00bar", 6); c = 'c'; d = 555; h = 666; strcpy(s, "donkey"); #if 0 printf("D: 0x%x H: 0x%x c: %c d: %d h: %d s: %s\n", D, H, c, d, h, s); #endif fail_unless(blob_pack(b, "whee:%D%H%*b%c%d%h%s\r\n", D, H, sizeof(buf), buf, c, d, h, s) == 0, "pack failed"); blob_rewind(b); #if 0 blob_print(b, "hexl", blob_left(b)); #endif fail_unless(blob_unpack(b, "whee:%D%H%*b%c%d%h%*s\r\n", &D, &H, sizeof(buf), buf, &c, &d, &h, sizeof(s), s) == 0, "unpack failed"); #if 0 printf("D: 0x%x H: 0x%x c: %c d: %d h: %d s: %s\n", D, H, c, d, h, s); #endif if (D != 0xdeadbeef || H != 0xbabe || memcmp(buf, "f\x00\x00bar", 6) != 0 || c != 'c' || d != 555 || h != 666 || strcmp(s, "donkey") != 0) fail("unpacked weird crap"); blob_free(b); } END_TEST START_TEST(test_blob_seek) { blob_t *b; b = blob_new(); blob_insert(b, "foobar", 6); blob_rewind(b); fail_unless(blob_skip(b, 3) == 3, "skip failed"); fail_unless(blob_skip(b, 3) == 6, "skip to end failed"); fail_unless(blob_skip(b, 1) < 0, "skipped past end"); fail_unless(blob_seek(b, -1, SEEK_END) == 5, "end seek failed"); fail_unless(blob_seek(b, 1, SEEK_SET) == 1, "set seek failed"); blob_rewind(b); fail_unless(blob_seek(b, -1, SEEK_CUR) < 0, "seeked past 0"); fail_unless(blob_seek(b, 3, SEEK_CUR) == 3, "cur seek failed"); blob_free(b); } END_TEST START_TEST(test_blob_index) { blob_t *b; b = blob_new(); blob_write(b, "this is only a test!", 20); blob_rewind(b); fail_unless(blob_index(b, "this", 4) == 0, "index start failed"); fail_unless(blob_index(b, "!", 1) == 19, "index end failed"); fail_unless(blob_index(b, "only ", 5) == 8, "index middle failed"); fail_unless(blob_rindex(b, "!", 1) == 19, "rindex end failed"); fail_unless(blob_rindex(b, "this", 4) == 0, "rindex start failed"); fail_unless(blob_rindex(b, "only ", 5) == 8, "rindex middle failed"); blob_free(b); } END_TEST Suite * blob_suite(void) { Suite *s = suite_create("blob"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_blob_newfree); tcase_add_test(tc_core, test_blob_readwrite); tcase_add_test(tc_core, test_blob_insertdelete); tcase_add_test(tc_core, test_blob_packunpack); tcase_add_test(tc_core, test_blob_seek); tcase_add_test(tc_core, test_blob_index); return (s); } int main(void) { Suite *s = blob_suite(); SRunner *sr = srunner_create(s); int nf; #if 0 srunner_set_fork_status(sr, CK_NOFORK); #endif srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_eth.c0000644000076500007650000000161510363372615021517 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_eth_pack) { } END_TEST START_TEST(test_eth_openclose) { } END_TEST START_TEST(test_eth_get) { } END_TEST START_TEST(test_eth_set) { } END_TEST START_TEST(test_eth_send) { } END_TEST Suite * eth_suite(void) { Suite *s = suite_create("eth"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_eth_pack); tcase_add_test(tc_core, test_eth_openclose); tcase_add_test(tc_core, test_eth_get); tcase_add_test(tc_core, test_eth_set); tcase_add_test(tc_core, test_eth_send); return (s); } int main(void) { Suite *s = eth_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_fw.c0000644000076500007650000000205510363372615021352 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_fw_pack) { } END_TEST START_TEST(test_fw_openclose) { fw_t *fw; fail_unless((fw = fw_open()) != NULL, "open failed"); fail_unless((fw = fw_close(fw)) == NULL, "closed failed"); } END_TEST START_TEST(test_fw_add) { } END_TEST START_TEST(test_fw_delete) { } END_TEST START_TEST(test_fw_loop) { } END_TEST START_TEST(test_fw_close) { } END_TEST Suite * fw_suite(void) { Suite *s = suite_create("fw"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_fw_pack); tcase_add_test(tc_core, test_fw_openclose); tcase_add_test(tc_core, test_fw_add); tcase_add_test(tc_core, test_fw_delete); tcase_add_test(tc_core, test_fw_loop); return (s); } int main(void) { Suite *s = fw_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_intf.c0000644000076500007650000000262210363372615021676 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_intf_openclose) { intf_t *i; fail_unless((i = intf_open()) != NULL, "open failed"); fail_unless((i = intf_close(i)) == NULL, "closed failed"); } END_TEST START_TEST(test_intf_get) { struct intf_entry ifent; intf_t *i; i = intf_open(); memset(&ifent, 0, sizeof(ifent)); fail_unless(intf_get(i, &ifent) < 0, "didn't fail on empty request"); ifent.intf_len = sizeof(ifent); fail_unless(intf_get(i, &ifent) < 0, "didn't fail on empty name"); intf_close(i); } END_TEST START_TEST(test_intf_get_src) { } END_TEST START_TEST(test_intf_get_dst) { } END_TEST START_TEST(test_intf_set) { } END_TEST START_TEST(test_intf_loop) { } END_TEST Suite * intf_suite(void) { Suite *s = suite_create("intf"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_intf_openclose); tcase_add_test(tc_core, test_intf_get); tcase_add_test(tc_core, test_intf_get_src); tcase_add_test(tc_core, test_intf_get_dst); tcase_add_test(tc_core, test_intf_set); tcase_add_test(tc_core, test_intf_loop); return (s); } int main(void) { Suite *s = intf_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_ip.c0000644000076500007650000000226010363372615021344 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_ip_fill) { } END_TEST START_TEST(test_ip_openclose) { ip_t *i; fail_unless((i = ip_open()) != NULL, "open failed"); fail_unless((i = ip_close(i)) == NULL, "close failed"); } END_TEST START_TEST(test_ip_send) { } END_TEST START_TEST(test_ip_ntoa) { } END_TEST START_TEST(test_ip_aton) { } END_TEST START_TEST(test_ip_add_option) { } END_TEST START_TEST(test_ip_checksum) { } END_TEST Suite * ip_suite(void) { Suite *s = suite_create("ip"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_ip_fill); tcase_add_test(tc_core, test_ip_openclose); tcase_add_test(tc_core, test_ip_send); tcase_add_test(tc_core, test_ip_ntoa); tcase_add_test(tc_core, test_ip_aton); tcase_add_test(tc_core, test_ip_add_option); tcase_add_test(tc_core, test_ip_checksum); return (s); } int main(void) { Suite *s = ip_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_rand.c0000644000076500007650000000405410363372615021663 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_rand_openclose) { rand_t *r; fail_unless((r = rand_open()) != NULL, "open failed"); fail_unless((r = rand_close(r)) == NULL, "close failed"); } END_TEST START_TEST(test_rand_get) { rand_t *r; uint32_t i; r = rand_open(); fail_unless(rand_get(r, &i, sizeof(i)) == 0, "get failed"); /* XXX - add distribution tests */ r = rand_close(r); } END_TEST START_TEST(test_rand_set) { rand_t *r; u_char buf1[BUFSIZ], buf2[BUFSIZ]; uint32_t i; i = 666; r = rand_open(); memset(buf1, 0, sizeof(buf1)); memset(buf2, 0, sizeof(buf2)); fail_unless(rand_get(r, buf1, sizeof(buf1)) == 0, "get failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) != 0, "get b0rked"); fail_unless(rand_set(r, &i, sizeof(i)) == 0, "set failed"); fail_unless(rand_get(r, buf2, sizeof(buf2)) == 0, "get2 failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) != 0, "set/get b0rked"); fail_unless(rand_set(r, &i, sizeof(i)) == 0, "set2 failed"); fail_unless(rand_get(r, buf1, sizeof(buf1)) == 0, "get3 failed"); fail_unless(memcmp(buf1, buf2, sizeof(buf1)) == 0, "set b0rked"); r = rand_close(r); } END_TEST START_TEST(test_rand_shuffle) { rand_t *r; char buf[BUFSIZ]; #define SHUFFLE_TEXT "hello how are you doing today?" r = rand_open(); strcpy(buf, SHUFFLE_TEXT); rand_shuffle(r, buf, strlen(buf), 1); fail_unless(strcmp(buf, SHUFFLE_TEXT) != 0, "shuffle failed"); r = rand_close(r); } END_TEST Suite * rand_suite(void) { Suite *s = suite_create("rand"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_rand_openclose); tcase_add_test(tc_core, test_rand_get); tcase_add_test(tc_core, test_rand_set); tcase_add_test(tc_core, test_rand_shuffle); return (s); } int main(void) { Suite *s = rand_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/check_route.c0000644000076500007650000000205610363372615022075 0ustar dugsongdugsong00000000000000 #include #include #include #include #include #include START_TEST(test_route_openclose) { route_t *r; fail_unless((r = route_open()) != NULL, "open failed"); fail_unless((r = route_close(r)) == NULL, "close failed"); } END_TEST START_TEST(test_route_add) { } END_TEST START_TEST(test_route_delete) { } END_TEST START_TEST(test_route_get) { } END_TEST START_TEST(test_route_loop) { } END_TEST Suite * route_suite(void) { Suite *s = suite_create("route"); TCase *tc_core = tcase_create("core"); suite_add_tcase(s, tc_core); tcase_add_test(tc_core, test_route_openclose); tcase_add_test(tc_core, test_route_add); tcase_add_test(tc_core, test_route_delete); tcase_add_test(tc_core, test_route_get); tcase_add_test(tc_core, test_route_loop); return (s); } int main(void) { Suite *s = route_suite(); SRunner *sr = srunner_create(s); int nf; srunner_run_all (sr, CK_NORMAL); nf = srunner_ntests_failed(sr); srunner_free(sr); return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } libdnet-1.12/trunk/test/check/Makefile.am0000644000076500007650000000122307640762604021472 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 427 2003-03-28 06:02:44Z dugsong $ include $(top_srcdir)/Makefile.am.common INCLUDES = -I$(top_srcdir)/include @CHECKINC@ if HAVE_CHECK TESTS = check_addr check_arp check_blob check_eth check_fw check_ip \ check_intf check_rand check_route else TESTS = endif noinst_PROGRAMS = $(TESTS) check_addr_SOURCES = check_addr.c check_arp_SOURCES = check_arp.c check_blob_SOURCES = check_blob.c check_eth_SOURCES = check_eth.c check_fw_SOURCES = check_fw.c check_intf_SOURCES = check_intf.c check_ip_SOURCES = check_ip.c check_rand_SOURCES = check_rand.c check_route_SOURCES = check_route.c LDADD = $(top_builddir)/src/libdnet.la @CHECKLIB@ libdnet-1.12/trunk/test/check/Makefile.in0000644000076500007650000003411410363627052021501 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include INCLUDES = -I$(top_srcdir)/include @CHECKINC@ @HAVE_CHECK_TRUE@TESTS = check_addr check_arp check_blob check_eth check_fw check_ip \ @HAVE_CHECK_TRUE@ check_intf check_rand check_route @HAVE_CHECK_FALSE@TESTS = noinst_PROGRAMS = $(TESTS) check_addr_SOURCES = check_addr.c check_arp_SOURCES = check_arp.c check_blob_SOURCES = check_blob.c check_eth_SOURCES = check_eth.c check_fw_SOURCES = check_fw.c check_intf_SOURCES = check_intf.c check_ip_SOURCES = check_ip.c check_rand_SOURCES = check_rand.c check_route_SOURCES = check_route.c LDADD = $(top_builddir)/src/libdnet.la @CHECKLIB@ subdir = test/check mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = @HAVE_CHECK_TRUE@noinst_PROGRAMS = check_addr$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_arp$(EXEEXT) check_blob$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_eth$(EXEEXT) check_fw$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_ip$(EXEEXT) check_intf$(EXEEXT) \ @HAVE_CHECK_TRUE@ check_rand$(EXEEXT) check_route$(EXEEXT) @HAVE_CHECK_FALSE@noinst_PROGRAMS = PROGRAMS = $(noinst_PROGRAMS) am_check_addr_OBJECTS = check_addr.$(OBJEXT) check_addr_OBJECTS = $(am_check_addr_OBJECTS) check_addr_LDADD = $(LDADD) check_addr_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_addr_LDFLAGS = am_check_arp_OBJECTS = check_arp.$(OBJEXT) check_arp_OBJECTS = $(am_check_arp_OBJECTS) check_arp_LDADD = $(LDADD) check_arp_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_arp_LDFLAGS = am_check_blob_OBJECTS = check_blob.$(OBJEXT) check_blob_OBJECTS = $(am_check_blob_OBJECTS) check_blob_LDADD = $(LDADD) check_blob_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_blob_LDFLAGS = am_check_eth_OBJECTS = check_eth.$(OBJEXT) check_eth_OBJECTS = $(am_check_eth_OBJECTS) check_eth_LDADD = $(LDADD) check_eth_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_eth_LDFLAGS = am_check_fw_OBJECTS = check_fw.$(OBJEXT) check_fw_OBJECTS = $(am_check_fw_OBJECTS) check_fw_LDADD = $(LDADD) check_fw_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_fw_LDFLAGS = am_check_intf_OBJECTS = check_intf.$(OBJEXT) check_intf_OBJECTS = $(am_check_intf_OBJECTS) check_intf_LDADD = $(LDADD) check_intf_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_intf_LDFLAGS = am_check_ip_OBJECTS = check_ip.$(OBJEXT) check_ip_OBJECTS = $(am_check_ip_OBJECTS) check_ip_LDADD = $(LDADD) check_ip_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_ip_LDFLAGS = am_check_rand_OBJECTS = check_rand.$(OBJEXT) check_rand_OBJECTS = $(am_check_rand_OBJECTS) check_rand_LDADD = $(LDADD) check_rand_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_rand_LDFLAGS = am_check_route_OBJECTS = check_route.$(OBJEXT) check_route_OBJECTS = $(am_check_route_OBJECTS) check_route_LDADD = $(LDADD) check_route_DEPENDENCIES = $(top_builddir)/src/libdnet.la check_route_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(check_addr_SOURCES) $(check_arp_SOURCES) \ $(check_blob_SOURCES) $(check_eth_SOURCES) $(check_fw_SOURCES) \ $(check_intf_SOURCES) $(check_ip_SOURCES) $(check_rand_SOURCES) \ $(check_route_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(check_addr_SOURCES) $(check_arp_SOURCES) $(check_blob_SOURCES) $(check_eth_SOURCES) $(check_fw_SOURCES) $(check_intf_SOURCES) $(check_ip_SOURCES) $(check_rand_SOURCES) $(check_route_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/check/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done check_addr$(EXEEXT): $(check_addr_OBJECTS) $(check_addr_DEPENDENCIES) @rm -f check_addr$(EXEEXT) $(LINK) $(check_addr_LDFLAGS) $(check_addr_OBJECTS) $(check_addr_LDADD) $(LIBS) check_arp$(EXEEXT): $(check_arp_OBJECTS) $(check_arp_DEPENDENCIES) @rm -f check_arp$(EXEEXT) $(LINK) $(check_arp_LDFLAGS) $(check_arp_OBJECTS) $(check_arp_LDADD) $(LIBS) check_blob$(EXEEXT): $(check_blob_OBJECTS) $(check_blob_DEPENDENCIES) @rm -f check_blob$(EXEEXT) $(LINK) $(check_blob_LDFLAGS) $(check_blob_OBJECTS) $(check_blob_LDADD) $(LIBS) check_eth$(EXEEXT): $(check_eth_OBJECTS) $(check_eth_DEPENDENCIES) @rm -f check_eth$(EXEEXT) $(LINK) $(check_eth_LDFLAGS) $(check_eth_OBJECTS) $(check_eth_LDADD) $(LIBS) check_fw$(EXEEXT): $(check_fw_OBJECTS) $(check_fw_DEPENDENCIES) @rm -f check_fw$(EXEEXT) $(LINK) $(check_fw_LDFLAGS) $(check_fw_OBJECTS) $(check_fw_LDADD) $(LIBS) check_intf$(EXEEXT): $(check_intf_OBJECTS) $(check_intf_DEPENDENCIES) @rm -f check_intf$(EXEEXT) $(LINK) $(check_intf_LDFLAGS) $(check_intf_OBJECTS) $(check_intf_LDADD) $(LIBS) check_ip$(EXEEXT): $(check_ip_OBJECTS) $(check_ip_DEPENDENCIES) @rm -f check_ip$(EXEEXT) $(LINK) $(check_ip_LDFLAGS) $(check_ip_OBJECTS) $(check_ip_LDADD) $(LIBS) check_rand$(EXEEXT): $(check_rand_OBJECTS) $(check_rand_DEPENDENCIES) @rm -f check_rand$(EXEEXT) $(LINK) $(check_rand_LDFLAGS) $(check_rand_OBJECTS) $(check_rand_LDADD) $(LIBS) check_route$(EXEEXT): $(check_route_OBJECTS) $(check_route_DEPENDENCIES) @rm -f check_route$(EXEEXT) $(LINK) $(check_route_LDFLAGS) $(check_route_OBJECTS) $(check_route_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am .PHONY: GTAGS all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libdnet-1.12/trunk/test/dnet/0000755000076500007650000000000010554406415017306 5ustar dugsongdugsong00000000000000libdnet-1.12/trunk/test/dnet/addr.c0000644000076500007650000000141207451002214020351 0ustar dugsongdugsong00000000000000/* * addr.c * * Copyright (c) 2001 Dug Song * * $Id: addr.c 315 2002-03-29 06:07:08Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "mod.h" void addr_usage(void) { fprintf(stderr, "Usage: dnet addr
...\n"); exit(1); } int addr_main(int argc, char *argv[]) { struct addr addr; int c, len; if (argc == 1 || *(argv[1]) == '-') addr_usage(); for (c = 1; c < argc; c++) { if (addr_aton(argv[c], &addr) < 0) addr_usage(); len = addr.addr_bits / 8; if (write(STDOUT_FILENO, addr.addr_data8, len) != len) err(1, "write"); } exit(0); } struct mod mod_addr = { "addr", MOD_TYPE_DATA, addr_main }; libdnet-1.12/trunk/test/dnet/arp.c0000644000076500007650000000732507466127704020254 0ustar dugsongdugsong00000000000000/* * arp.c * * Copyright (c) 2001 Dug Song * * $Id: arp.c 352 2002-05-08 04:55:32Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void arp_usage(void) { fprintf(stderr, "Usage: dnet arp [op|sha|spa|tha|tpa ] ...\n" " dnet arp show\n" " dnet arp get \n" " dnet arp add \n" " dnet arp delete \n"); exit(1); } static int print_arp(const struct arp_entry *entry, void *arg) { printf("%s at %s\n", addr_ntoa(&entry->arp_pa), addr_ntoa(&entry->arp_ha)); return (0); } static int arp_kern_main(int argc, char *argv[]) { struct arp_entry entry; arp_t *arp; char *cmd; if (argc < 2) arp_usage(); cmd = argv[1]; if ((arp = arp_open()) == NULL) err(1, "arp_open"); if (strcmp(cmd, "show") == 0) { if (arp_loop(arp, print_arp, NULL) < 0) err(1, "arp_loop"); } else if (strcmp(cmd, "get") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0) err(1, "addr_pton"); if (arp_get(arp, &entry) < 0) err(1, "arp_get"); print_arp(&entry, NULL); } else if (strcmp(cmd, "add") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0 || addr_pton(argv[3], &entry.arp_ha) < 0) err(1, "addr_pton"); if (arp_add(arp, &entry) < 0) err(1, "arp_add"); printf("%s added\n", addr_ntoa(&entry.arp_pa)); } else if (strcmp(cmd, "delete") == 0) { if (addr_pton(argv[2], &entry.arp_pa) < 0) err(1, "addr_pton"); if (arp_delete(arp, &entry) < 0) err(1, "arp_delete"); printf("%s deleted\n", addr_ntoa(&entry.arp_pa)); } else arp_usage(); arp_close(arp); return (0); } int arp_main(int argc, char *argv[]) { struct arp_hdr *arp; struct arp_ethip *ethip; struct addr addr; u_char *p, buf[ETH_MTU]; /* XXX */ char *name, *value; int c, len; if (argc == 1 || *(argv[1]) == '-') arp_usage(); /* XXX - total trash */ if (argc > 1 && (strcmp(argv[1], "show") == 0 || strcmp(argv[1], "get") == 0 || strcmp(argv[1], "add") == 0 || strcmp(argv[1], "delete") == 0)) return (arp_kern_main(argc, argv)); srand(time(NULL)); arp = (struct arp_hdr *)buf; arp->ar_hrd = htons(ARP_HRD_ETH); arp->ar_pro = htons(ARP_PRO_IP); arp->ar_hln = ETH_ADDR_LEN; arp->ar_pln = IP_ADDR_LEN; arp->ar_op = ARP_OP_REQUEST; ethip = (struct arp_ethip *)(buf + ARP_HDR_LEN); memset(ethip, 0, sizeof(*ethip)); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "op") == 0) { if (op_aton(value, &arp->ar_op) < 0) arp_usage(); } else if (strcmp(name, "sha") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_sha, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "spa") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_spa, &addr.addr_ip, IP_ADDR_LEN); } else if (strcmp(name, "tha") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_tha, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "tpa") == 0) { if (addr_aton(value, &addr) < 0) arp_usage(); memcpy(ethip->ar_tpa, &addr.addr_ip, IP_ADDR_LEN); } else arp_usage(); } argc -= c; argv += c; if (argc != 0) arp_usage(); p = buf + ARP_HDR_LEN + ARP_ETHIP_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_arp = { "arp", MOD_TYPE_ENCAP|MOD_TYPE_KERN, arp_main }; libdnet-1.12/trunk/test/dnet/aton.c0000644000076500007650000000760307552562722020431 0ustar dugsongdugsong00000000000000/* * aton.c * * Copyright (c) 2001 Dug Song * * $Id: aton.c 366 2002-10-14 15:42:10Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" int type_aton(char *string, uint16_t *type) { u_int i; if (strcmp(string, "ip") == 0) *type = htons(ETH_TYPE_IP); else if (strcmp(string, "arp") == 0) *type = htons(ETH_TYPE_ARP); else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *type = htons(i & 0xffff); } return (0); } int op_aton(char *string, uint16_t *op) { u_int i; if (strncasecmp(string, "req", 3) == 0) *op = htons(ARP_OP_REQUEST); else if (strncasecmp(string, "rep", 3) == 0) *op = htons(ARP_OP_REPLY); else if (strncasecmp(string, "revreq", 6) == 0) *op = htons(ARP_OP_REVREQUEST); else if (strncasecmp(string, "revrep", 6) == 0) *op = htons(ARP_OP_REVREPLY); else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *op = htons(i & 0xffff); } return (0); } int proto_aton(char *string, uint8_t *proto) { struct protoent *pp; u_int i; if ((pp = getprotobyname(string)) != NULL) *proto = pp->p_proto; else { if (sscanf(string, "%i", &i) != 1 || i > 0xff) return (-1); *proto = i & 0xff; } return (0); } int off_aton(char *string, uint16_t *off) { int i; char *p; if (strncmp(string, "0x", 2) == 0) { if (sscanf(string, "%i", &i) != 1 || i > IP_OFFMASK) return (-1); *off = htons(i); } else { i = strtol(string, &p, 10); if (*string == '\0' || (*p != '\0' && *p != '+') || i > IP_OFFMASK) return (-1); *off = htons(((*p == '+') ? IP_MF : 0) | (i >> 3)); } return (0); } int port_aton(char *string, uint16_t *port) { struct servent *sp; u_int i; /* XXX */ if ((sp = getservbyname(string, "tcp")) != NULL) { *port = sp->s_port; } else if ((sp = getservbyname(string, "udp")) != NULL) { *port = sp->s_port; } else { if (sscanf(string, "%i", &i) != 1 || i > 0xffff) return (-1); *port = htons(i & 0xffff); } return (0); } int seq_aton(char *string, uint32_t *seq) { char *p; *seq = strtoul(string, &p, 10); if (*string == '\0' || *p != '\0') return (-1); *seq = htonl(*seq); return (0); } int flags_aton(char *string, uint8_t *flags) { char *p; u_int i; *flags = 0; if (strncmp(string, "0x", 2) == 0) { if (sscanf(string, "%i", &i) != 1 || i > 0xff) return (-1); *flags = i & 0xff; return (0); } for (p = string; *p != '\0'; p++) { switch (*p) { case 'S': *flags |= TH_SYN; break; case 'A': *flags |= TH_ACK; break; case 'F': *flags |= TH_FIN; break; case 'R': *flags |= TH_RST; break; case 'P': *flags |= TH_PUSH; break; case 'U': *flags |= TH_URG; break; default: return (-1); } } return (0); } static u_char hex2num(char ch, char cl) { ch = tolower(ch), cl = tolower(cl); if (ch >= '0' && ch <= '9') ch -= '0'; else if (ch >= 'a' && ch <= 'f') ch -= 'a' - 10; else return (0); if (cl >= '0' && cl <= '9') cl -= '0'; else if (cl >= 'a' && cl <= 'f') cl -= 'a' - 10; else return (0); return ((u_char)((ch << 4) | cl)); } int fmt_aton(char *string, u_char *buf) { u_char *u; char *p; for (u = buf, p = string; *p != '\0'; p++) { if (*p != '\\') { *u++ = *p; continue; } if (*++p == '\0') break; if (*p == '\\') *u++ = '\\'; else if (*p == '\'') *u++ = '\''; else if (*p == '"') *u++ = '"'; else if (*p == 'a') *u++ = '\a'; else if (*p == 'b') *u++ = '\b'; else if (*p == 'e') *u++ = 033; else if (*p == 'f') *u++ = '\f'; else if (*p == 'n') *u++ = '\n'; else if (*p == 'r') *u++ = '\r'; else if (*p == 't') *u++ = '\t'; else if (*p == 'v') *u++ = '\v'; else if (*p == 'x' && p[1] != '\0' && p[2] != '\0') { *u++ = hex2num(p[1], p[2]); p += 2; } else return (-1); } return (u - buf); } libdnet-1.12/trunk/test/dnet/aton.h0000644000076500007650000000102007430676702020420 0ustar dugsongdugsong00000000000000/* * aton.h * * Copyright (c) 2002 Dug Song * * $Id: aton.h 274 2002-02-08 07:26:58Z dugsong $ */ #ifndef ATON_H #define ATON_H int type_aton(char *string, uint16_t *type); int op_aton(char *string, uint16_t *op); int proto_aton(char *string, uint8_t *proto); int off_aton(char *string, uint16_t *off); int port_aton(char *string, uint16_t *port); int seq_aton(char *string, uint32_t *seq); int flags_aton(char *string, uint8_t *flags); int fmt_aton(char *string, u_char *buf); #endif /* ATON_H */ libdnet-1.12/trunk/test/dnet/dnet.80000644000076500007650000001437607452004046020341 0ustar dugsongdugsong00000000000000.\" $Id: dnet.8 328 2002-04-01 07:11:34Z dugsong $ .\" .\" Copyright (c) 2001 Dug Song .\" .Dd October 17, 2001 .Dt DNET 8 .Os .Sh NAME .Nm dnet .Nd dumb networking library test program .Sh SYNOPSIS .Nm dnet Ar command Ar args Op ... .Sh DESCRIPTION .Nm is a simple test program for the .Xr dnet 3 library. It can be used to compose and transmit network datagrams as a Unix-style filter (e.g. reading from or writing to files and pipes) or modify the local system network configuration (including the ARP cache, firewall ruleset, network interfaces, and routing table). .Pp .Ss Payload generation commands .Bl -tag -width "foo" .It Nm addr Ar address Op ... Convert the .Ar address (specified as a hostname, IP address, or MAC address) into its binary representation on standard output. .It Nm hex Ar string Op ... Convert the C-style escaped .Ar string (shellcode, for instance) into its binary representation on standard output. .It Nm rand Ar len Write .Ar len random bytes to standard output. .El .Ss Packet encapsulation commands .Bl -tag -width "foo" .It Xo .Nm eth .Op Nm type Ar type .Op Nm src Ar mac .Op Nm dst Ar mac .Xc Prepend the data read from standard input with an Ethernet header on standard output. The Ethernet .Ar type may be specified as .Ql arp , .Ql ip , or as a hex, octal, or decimal number. .It Xo .Nm arp .Op Nm op Ar op .Op Nm sha Ar mac .Op Nm spa Ar host .Op Nm tha Ar mac .Op Nm tpa Ar host .Xc Prepend the data read from standard input with an ARP header on standard output. The ARP .Ar op may be specified as .Ql req , .Ql rep , .Ql revreq , .Ql revrep , or as a hex, octal, or decimal number. .It Xo .Nm ip .Op Nm tos Ar num .Op Nm id Ar num .Op Nm off Ar offset .Op Nm ttl Ar num .Op Nm proto Ar protocol .Op Nm src Ar host .Bk -words .Op Nm dst Ar dst .Ek .Xc Prepend the data read from standard input with an IP header on standard output. The fragmentation .Ar offset may be specified as a decimal number (optionally concatenated with .Ql + to indicate more fragments) or as a hex number. The .Ar protocol may be specified by name, or as a hex, octal, or decimal number. .It Xo .Nm icmp .Op Nm type Ar num .Op Nm code Ar num .Xc Prepend the data read from standard input with an ICMP header on standard output. .It Xo .Nm tcp .Op Nm sport Ar port .Op Nm dport Ar port .Op Nm flags Ar flags .Op Nm seq Ar num .Op Nm ack Ar num .Op Nm win Ar num .Op Nm urp Ar num .Xc Prepend the data read from standard input with a TCP header on standard output. A .Ar port may be specified by name or hex, octal, or decimal number. The TCP .Ar flags may be specified as some combination of the characters in the set .Ql SAFRPU or as a hex number. .It Xo .Nm udp .Op Nm sport Ar port .Op Nm dport Ar port .Xc Prepend the data read from standard input with a UDP header on standard output. A .Ar port may be specified by name or hex, octal, or decimal number. .El .Ss Packet transmission commands .Bl -tag -width "foo" .It Nm send Op Ar device Read a packet from standard input and send it over the network. If no .Ar device is specified, the packet is assumed to be an IP datagram and routed to its destination. Otherwise, the packet is assumed to be an Ethernet frame and is transmitted on the specified interface. .El .Ss Kernel interface commands .Bl -tag -width "foo" .It Nm arp show Display the kernel ARP cache. .It Nm arp get Ar host Display the kernel ARP entry for .Ar host . .It Nm arp add Ar host Ar mac Add an ARP entry mapping the .Ar mac address for .Ar host . .It Nm arp delete Ar host Delete the ARP entry for .Ar host . .Pp .It Nm fw show Display the kernel firewall ruleset. .It Xo .Nm fw add Ns \&| Ns Nm delete .Ar action Ar direction Ar device .Ar protocol .Ar src Ns Op \&: Ns Ar port[-max] .Ar dst Ns Op \&: Ns Ar port[-max] .Op Ar type Ns Op /code .Xc Add a rule to or delete a rule from the active firewall ruleset. The .Ar action must be either .Ql allow or .Ql block . The direction must be either .Ql in or .Ql out . The .Ar device may specify an interface name, or .Ql any . The .Ar protocol may be specified by name, or as a decimal number. For TCP and UDP protocols, a .Ar port (or range, if specified with a .Ar max value) may be specified in decimal and appended to the source and/or destination address. For ICMP, a .Ar type (and optional .Ar code ) may be specified in decimal. .It Nm intf show Display the configuration of all network interfaces. .It Nm intf get Ar device Display the configuration for the interface specified by .Ar device . .It Xo .Nm intf set .Ar device .Op Nm alias Ar host .Op Nm dst Ar host .Op Nm inet Ar host .Op Nm link Ar mac .Op Nm up Ns \&| Ns Nm down .Op Nm arp Ns \&| Ns Nm noarp .Xc Configure the interface specified by .Ar device . .It Nm route show Display the kernel routing table. .It Nm route get Ar dst Display the route for the destination .Ar dst , specified as a hostname, IP address, or network prefix in CIDR notation. .It Nm route add Ar dst Ar gw Add a route for the destination .Ar dst through the gateway .Ar gw . .It Nm route delete Ar dst Delete the route for the destination .Ar dst . .El .Sh EXAMPLES Send a UDP datagram containing random shellcode: .Bd -literal -offset indent dnet hex "\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89" \\ "\\x46\\x0c\\xb0\\x0b\\x89\\xf3\\x8d\\x4e\\x08\\x8d\\x56\\x0c\\xcd\\x80" \\ "\\x31\\xdb\\x89\\xd8\\x40\\xcd\\x80\\xe8\\xdc\\xff\\xff\\xff/bin/sh" | \\ dnet udp sport 555 dport 666 | \\ dnet ip proto udp src 1.2.3.4 dst 5.6.7.8 | dnet send .Ed .Pp Save an ARP request in a file and send it twice: .Bd -literal -offset indent dnet arp op req sha 0:d:e:a:d:0 spa 10.0.0.3 tpa 10.0.0.4 | \\ dnet eth type arp src 0:d:e:a:d:0 dst ff:ff:ff:ff:ff:ff > arp.pkt dnet send fxp0 < arp.pkt dnet send fxp0 < arp.pkt .Ed .Pp Send a fragmented ping packet: .Bd -literal -offset indent # Create ping packet with IP header, to set ICMP checksum echo "monkey monkey monkey monkey" | dnet icmp type 8 code 0 | \\ dnet ip proto icmp src 1.2.3.4 dst 5.6.7.8 > ping.pkt # Chop off IP header dd if=ping.pkt of=ping.data bs=20 skip=1 # Fragment IP payload split -b 24 ping.data p. # Send fragments dnet ip id 1 off 0+ proto icmp src 1.2.3.4 dst 5.6.7.8 < p.aa | \\ dnet send dnet ip id 1 off 24 proto icmp src 1.2.3.4 dst 5.6.7.8 < p.ab | \\ dnet send .Ed .Sh SEE ALSO .Xr dnet 3 .Sh AUTHORS Dug Song .Aq dugsong@monkey.org libdnet-1.12/trunk/test/dnet/dnet.c0000644000076500007650000000355407451002265020410 0ustar dugsongdugsong00000000000000/* * dnet.c * * Copyright (c) 2001 Dug Song * * $Id: dnet.c 317 2002-03-29 06:07:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "mod.h" /* * XXX - new modules should be registered here */ extern struct mod mod_addr; extern struct mod mod_hex; extern struct mod mod_rand; extern struct mod mod_eth; extern struct mod mod_arp; extern struct mod mod_ip; extern struct mod mod_icmp; extern struct mod mod_tcp; extern struct mod mod_udp; extern struct mod mod_send; extern struct mod mod_fw; extern struct mod mod_intf; extern struct mod mod_route; static struct mod *modules[] = { &mod_addr, &mod_hex, &mod_rand, &mod_eth, &mod_arp, &mod_ip, &mod_icmp, &mod_tcp, &mod_udp, &mod_send, &mod_fw, &mod_intf, &mod_route, NULL }; static void print_modules(int type, char *string) { struct mod **m; int i; fprintf(stderr, "%s commands:\n", string); for (i = 1, m = modules; *m != NULL; m++) { if ((m[0]->type & type) != 0) { fprintf(stderr, "%-10s", m[0]->name); if ((i++ % 8) == 0) fprintf(stderr, "\n"); } } fprintf(stderr, "\n\n"); } static void print_usage(void) { fprintf(stderr, "Usage: dnet ...\n\n"); print_modules(MOD_TYPE_DATA, "Payload generation"); print_modules(MOD_TYPE_ENCAP, "Packet encapsulation"); print_modules(MOD_TYPE_XMIT, "Packet transmission"); print_modules(MOD_TYPE_KERN, "Kernel interface"); } static int do_command(int argc, char *argv[]) { struct mod **m; for (m = modules; *m != NULL; m++) { if (strcmp(argv[0], m[0]->name) == 0) return (m[0]->main(argc, argv)); } return (-1); } int main(int argc, char *argv[]) { if (argc < 2) { print_usage(); exit(1); } if (do_command(argc - 1, argv + 1) < 0) { print_usage(); exit(1); } exit(0); } libdnet-1.12/trunk/test/dnet/eth.c0000644000076500007650000000311207430700671020227 0ustar dugsongdugsong00000000000000/* * eth.c * * Copyright (c) 2001 Dug Song * * $Id: eth.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void eth_usage(void) { fprintf(stderr, "Usage: dnet eth [type|src|dst ] ... \n"); exit(1); } int eth_main(int argc, char *argv[]) { struct eth_hdr *eth; struct addr addr; u_char *p, buf[ETH_LEN_MAX]; /* XXX */ char *name, *value; int c, len; eth = (struct eth_hdr *)buf; memset(eth, 0, sizeof(*eth)); eth->eth_type = htons(ETH_TYPE_IP); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "type") == 0) { if (type_aton(value, ð->eth_type) < 0) eth_usage(); } else if (strcmp(name, "src") == 0) { if (addr_aton(value, &addr) < 0) eth_usage(); memcpy(ð->eth_src, &addr.addr_eth, ETH_ADDR_LEN); } else if (strcmp(name, "dst") == 0) { if (addr_aton(value, &addr) < 0) eth_usage(); memcpy(ð->eth_dst, &addr.addr_eth, ETH_ADDR_LEN); } else eth_usage(); } argc -= c; argv += c; if (argc != 0) eth_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read Ethernet payload from tty"); p = buf + ETH_HDR_LEN; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_eth = { "eth", MOD_TYPE_ENCAP, eth_main }; libdnet-1.12/trunk/test/dnet/fw.c0000644000076500007650000001075610204206720020064 0ustar dugsongdugsong00000000000000/* * fw.c * * Copyright (c) 2001 Dug Song * * $Id: fw.c 577 2005-02-14 20:45:04Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static void usage(void) { fprintf(stderr, "Usage: dnet fw show\n" " dnet fw add|delete allow|block in|out " "|any [:[-]] " "[:[-]] [[/]]\n"); exit(1); } static int print_rule(const struct fw_rule *fr, void *arg) { struct protoent *pr; char proto[16], sport[16], dport[16], typecode[16]; if (fr->fw_proto == 0) proto[0] = '\0'; else if ((pr = getprotobynumber(fr->fw_proto)) == NULL) snprintf(proto, sizeof(proto), "%d ", fr->fw_proto); else snprintf(proto, sizeof(proto), "%s ", pr->p_name); sport[0] = dport[0] = typecode[0] = '\0'; switch (fr->fw_proto) { case IP_PROTO_ICMP: if (fr->fw_sport[1] && fr->fw_dport[1]) snprintf(typecode, sizeof(typecode), " %d/%d", fr->fw_sport[0], fr->fw_dport[0]); else if (fr->fw_sport[1]) snprintf(typecode, sizeof(typecode), " %d", fr->fw_sport[0]); break; case IP_PROTO_TCP: case IP_PROTO_UDP: if (fr->fw_sport[0] == fr->fw_sport[1]) { snprintf(sport, sizeof(sport), ":%d", fr->fw_sport[0]); } else snprintf(sport, sizeof(sport), ":%d-%d", fr->fw_sport[0], fr->fw_sport[1]); if (fr->fw_dport[0] == fr->fw_dport[1]) { snprintf(dport, sizeof(dport), ":%d", fr->fw_dport[0]); } else snprintf(dport, sizeof(dport), ":%d-%d", fr->fw_dport[0], fr->fw_dport[1]); break; } printf("%s %s %s %s%s%s %s%s%s\n", fr->fw_op == FW_OP_ALLOW ? "allow" : "block", fr->fw_dir == FW_DIR_IN ? "in" : "out", *fr->fw_device ? fr->fw_device : "any", proto, fr->fw_src.addr_type ? addr_ntoa(&fr->fw_src) : "", sport, fr->fw_dst.addr_type ? addr_ntoa(&fr->fw_dst) : "", dport, typecode); return (0); } static int arg_to_fr(int argc, char *argv[], struct fw_rule *fr) { struct protoent *pr; char *p; if (argc < 6) { errno = EINVAL; return (-1); } memset(fr, 0, sizeof(*fr)); fr->fw_op = strcmp(argv[0], "allow") ? FW_OP_BLOCK : FW_OP_ALLOW; fr->fw_dir = strcmp(argv[1], "in") ? FW_DIR_OUT : FW_DIR_IN; if (strcmp(argv[2], "any") != 0) strlcpy(fr->fw_device, argv[2], sizeof(fr->fw_device)); if ((pr = getprotobyname(argv[3])) != NULL) fr->fw_proto = pr->p_proto; else fr->fw_proto = atoi(argv[3]); p = strtok(argv[4], ":"); if (addr_aton(p, &fr->fw_src) < 0) return (-1); if ((p = strtok(NULL, ":")) != NULL) { fr->fw_sport[0] = (uint16_t)strtol(p, &p, 10); if (*p == '-') fr->fw_sport[1] = (uint16_t)strtol(p + 1, NULL, 10); else fr->fw_sport[1] = fr->fw_sport[0]; } else if (fr->fw_proto == IP_PROTO_TCP || fr->fw_proto == IP_PROTO_UDP) { fr->fw_sport[0] = 0; fr->fw_sport[1] = TCP_PORT_MAX; } p = strtok(argv[5], ":"); if (addr_aton(p, &fr->fw_dst) < 0) return (-1); if ((p = strtok(NULL, ":")) != NULL) { fr->fw_dport[0] = (uint16_t)strtol(p, &p, 10); if (*p == '-') fr->fw_dport[1] = (uint16_t)strtol(p + 1, NULL, 10); else fr->fw_dport[1] = fr->fw_dport[0]; } else if (fr->fw_proto == IP_PROTO_TCP || fr->fw_proto == IP_PROTO_UDP) { fr->fw_dport[0] = 0; fr->fw_dport[1] = TCP_PORT_MAX; } if (argc > 6) { if (fr->fw_proto != IP_PROTO_ICMP && fr->fw_proto != IP_PROTO_IGMP) { errno = EINVAL; return (-1); } fr->fw_sport[0] = (uint16_t)strtol(argv[6], &p, 10); fr->fw_sport[1] = 0xff; if (*p == '/') { fr->fw_dport[0] = (uint16_t)strtol(p + 1, NULL, 10); fr->fw_dport[1] = 0xff; } } return (0); } int fw_main(int argc, char *argv[]) { struct fw_rule fr; fw_t *fw; if (argc < 2 || *(argv[1]) == '-') usage(); if ((fw = fw_open()) == NULL) err(1, "fw_open"); if (argc == 2 && strcmp(argv[1], "show") == 0) { if (fw_loop(fw, print_rule, NULL) < 0) err(1, "fw_loop"); } else if (argc > 2 && strcmp(argv[1], "add") == 0) { if (arg_to_fr(argc - 2, argv + 2, &fr) < 0) err(1, "arg_to_fr"); printf("+ "); print_rule(&fr, NULL); if (fw_add(fw, &fr) < 0) err(1, "fw_add"); } else if (argc > 2 && strcmp(argv[1], "delete") == 0) { if (arg_to_fr(argc - 2, argv + 2, &fr) < 0) err(1, "arg_to_fr"); printf("- "); print_rule(&fr, NULL); if (fw_delete(fw, &fr) < 0) err(1, "fw_delete"); } else usage(); fw_close(fw); exit(0); } struct mod mod_fw = { "fw", MOD_TYPE_KERN, fw_main }; libdnet-1.12/trunk/test/dnet/hex.c0000644000076500007650000000200510031606612020222 0ustar dugsongdugsong00000000000000/* * hex.c * * Copyright (c) 2001 Dug Song * * $Id: hex.c 488 2004-03-28 17:38:18Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void hex_usage(void) { fprintf(stderr, "Usage: dnet hex ...\n"); exit(1); } int hex_main(int argc, char *argv[]) { char buf[IP_LEN_MAX], *p = buf; int c, len; if (argc == 1 || *(argv[1]) == '-') hex_usage(); for (c = 1; c < argc; c++) { if ((len = fmt_aton(argv[c], (u_char *)argv[c])) < 0) hex_usage(); if (write(STDOUT_FILENO, argv[c], len) != len) err(1, "write"); } if (!isatty(STDIN_FILENO)) { len = sizeof(buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); } return (0); } struct mod mod_hex = { "hex", MOD_TYPE_DATA, hex_main }; libdnet-1.12/trunk/test/dnet/icmp.c0000644000076500007650000000245507430700671020410 0ustar dugsongdugsong00000000000000/* * icmp.c * * Copyright (c) 2001 Dug Song * * $Id: icmp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void icmp_usage(void) { fprintf(stderr, "Usage: dnet icmp [type|code ] ...\n"); exit(1); } int icmp_main(int argc, char *argv[]) { struct icmp_hdr *icmp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; icmp = (struct icmp_hdr *)buf; memset(icmp, 0, sizeof(*icmp)); icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "type") == 0) { icmp->icmp_type = atoi(value); } else if (strcmp(name, "code") == 0) { icmp->icmp_code = atoi(value); } else icmp_usage(); } argc -= c; argv += c; if (argc != 0) icmp_usage(); p = buf + ICMP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_icmp = { "icmp", MOD_TYPE_ENCAP, icmp_main }; libdnet-1.12/trunk/test/dnet/intf.c0000644000076500007650000001027410000712614020401 0ustar dugsongdugsong00000000000000/* * intf.c * * Copyright (c) 2001 Dug Song * * $Id: intf.c 473 2004-01-13 06:51:56Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static intf_t *intf; static void usage(void) { fprintf(stderr, "Usage: dnet intf show\n" " dnet intf get \n" " dnet intf set " "[alias|dst|inet|link ...] [up|down|arp|noarp ...]\n" " dnet intf src \n" " dnet intf dst \n" ); exit(1); } static char * flags2string(u_short flags) { static char buf[256]; buf[0] = '\0'; if (flags & INTF_FLAG_UP) strlcat(buf, ",UP", sizeof(buf)); if (flags & INTF_FLAG_LOOPBACK) strlcat(buf, ",LOOPBACK", sizeof(buf)); if (flags & INTF_FLAG_POINTOPOINT) strlcat(buf, ",POINTOPOINT", sizeof(buf)); if (flags & INTF_FLAG_NOARP) strlcat(buf, ",NOARP", sizeof(buf)); if (flags & INTF_FLAG_BROADCAST) strlcat(buf, ",BROADCAST", sizeof(buf)); if (flags & INTF_FLAG_MULTICAST) strlcat(buf, ",MULTICAST", sizeof(buf)); if (buf[0] != '\0') return (buf + 1); return (buf); } static int print_intf(const struct intf_entry *entry, void *arg) { int i; printf("%s:", entry->intf_name); printf(" flags=0x%x<%s>", entry->intf_flags, flags2string(entry->intf_flags)); if (entry->intf_mtu != 0) printf(" mtu %d", entry->intf_mtu); printf("\n"); if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { if (entry->intf_dst_addr.addr_type == ADDR_TYPE_IP) { printf("\tinet %s --> %s\n", addr_ntoa(&entry->intf_addr), addr_ntoa(&entry->intf_dst_addr)); } else printf("\tinet %s\n", addr_ntoa(&entry->intf_addr)); } if (entry->intf_link_addr.addr_type == ADDR_TYPE_ETH) printf("\tlink %s\n", addr_ntoa(&entry->intf_link_addr)); for (i = 0; i < entry->intf_alias_num; i++) printf("\talias %s\n", addr_ntoa(&entry->intf_alias_addrs[i])); return (0); } int intf_main(int argc, char *argv[]) { struct intf_entry *entry; struct addr *ap, addr; char *cmd, buf[1024]; if (argc < 2) usage(); cmd = argv[1]; entry = (struct intf_entry *)buf; memset(entry, 0, sizeof(*entry)); entry->intf_len = sizeof(buf); if ((intf = intf_open()) == NULL) err(1, "intf_open"); if (strcmp(cmd, "show") == 0) { if (intf_loop(intf, print_intf, NULL) < 0) err(1, "intf_loop"); } else if (strcmp(cmd, "get") == 0) { if (argc < 3) usage(); strlcpy(entry->intf_name, argv[2], sizeof(entry->intf_name)); if (intf_get(intf, entry) < 0) err(1, "intf_get"); print_intf(entry, NULL); } else if (strcmp(cmd, "src") == 0) { if (argc < 3 || addr_aton(argv[2], &addr) < 0) usage(); if (intf_get_src(intf, entry, &addr) < 0) err(1, "intf_get_src"); print_intf(entry, NULL); } else if (strcmp(cmd, "dst") == 0) { if (argc < 3 || addr_aton(argv[2], &addr) < 0) usage(); if (intf_get_dst(intf, entry, &addr) < 0) err(1, "intf_get_dst"); print_intf(entry, NULL); } else if (strcmp(cmd, "set") == 0) { if (argc < 4) usage(); strlcpy(entry->intf_name, argv[2], sizeof(entry->intf_name)); for (argv += 3, argc -= 3; argc > 1; argv += 2, argc -= 2) { if (strcmp(argv[0], "alias") == 0) { ap = &entry->intf_alias_addrs [entry->intf_alias_num++]; } else if (strcmp(argv[0], "dst") == 0) { ap = &entry->intf_dst_addr; } else if (strcmp(argv[0], "inet") == 0) { ap = &entry->intf_addr; } else if (strcmp(argv[0], "link") == 0) { ap = &entry->intf_link_addr; } else break; if (addr_pton(argv[1], ap) < 0) err(1, "invalid address: %s", argv[1]); } for ( ; argc > 0; argv++, argc--) { if (strcmp(argv[0], "up") == 0) entry->intf_flags |= INTF_FLAG_UP; else if (strcmp(argv[0], "down") == 0) entry->intf_flags &= ~INTF_FLAG_UP; else if (strcmp(argv[0], "arp") == 0) entry->intf_flags &= ~INTF_FLAG_NOARP; else if (strcmp(argv[0], "noarp") == 0) entry->intf_flags |= INTF_FLAG_NOARP; else usage(); } if (intf_set(intf, entry) < 0) err(1, "intf_set"); } else usage(); intf_close(intf); exit(0); } struct mod mod_intf = { "intf", MOD_TYPE_KERN, intf_main }; libdnet-1.12/trunk/test/dnet/ip.c0000644000076500007650000000405407430700671020065 0ustar dugsongdugsong00000000000000/* * ip.c * * Copyright (c) 2001 Dug Song * * $Id: ip.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void ip_usage(void) { fprintf(stderr, "Usage: dnet ip [tos|id|off|ttl|proto|src|dst " "] ... \n"); exit(1); } int ip_main(int argc, char *argv[]) { struct ip_hdr *ip; struct addr addr; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); ip = (struct ip_hdr *)buf; ip->ip_hl = 5; ip->ip_v = 4; ip->ip_tos = 0; ip->ip_id = rand() & 0xffff; ip->ip_off = 0; ip->ip_ttl = IP_TTL_MAX; ip->ip_p = rand() & 0xff; ip->ip_sum = 0; ip->ip_src = rand(); ip->ip_dst = rand(); for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "tos") == 0) ip->ip_tos = atoi(value); else if (strcmp(name, "id") == 0) ip->ip_id = ntohs(atoi(value)); else if (strcmp(name, "off") == 0) { if (off_aton(value, &ip->ip_off) < 0) ip_usage(); } else if (strcmp(name, "ttl") == 0) ip->ip_ttl = atoi(value); else if (strcmp(name, "proto") == 0) { if (proto_aton(value, &ip->ip_p) < 0) ip_usage(); } else if (strcmp(name, "src") == 0) { if (addr_aton(value, &addr) < 0) ip_usage(); ip->ip_src = addr.addr_ip; } else if (strcmp(name, "dst") == 0) { if (addr_aton(value, &addr) < 0) ip_usage(); ip->ip_dst = addr.addr_ip; } else ip_usage(); } argc -= c; argv += c; if (argc != 0) ip_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read IP payload from tty"); p = buf + IP_HDR_LEN; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; ip->ip_len = htons(len); ip_checksum(buf, len); if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_ip = { "ip", MOD_TYPE_ENCAP, ip_main }; libdnet-1.12/trunk/test/dnet/Makefile.am0000644000076500007650000000063007640762604021350 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 427 2003-03-28 06:02:44Z dugsong $ include $(top_srcdir)/Makefile.am.common sbin_PROGRAMS = dnet dnet_SOURCES = addr.c arp.c aton.c aton.h dnet.c eth.c fw.c hex.c \ icmp.c intf.c ip.c mod.h rand.c route.c send.c tcp.c udp.c man_MANS = dnet.8 EXTRA_DIST = $(man_MANS) dnet_LDADD = $(top_builddir)/src/libdnet.la dnet.8.txt: dnet.8 groff -t -e -mdoc -Tascii dnet.8 | col -bx > $@ libdnet-1.12/trunk/test/dnet/Makefile.in0000644000076500007650000002650410363627052021362 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include sbin_PROGRAMS = dnet dnet_SOURCES = addr.c arp.c aton.c aton.h dnet.c eth.c fw.c hex.c \ icmp.c intf.c ip.c mod.h rand.c route.c send.c tcp.c udp.c man_MANS = dnet.8 EXTRA_DIST = $(man_MANS) dnet_LDADD = $(top_builddir)/src/libdnet.la subdir = test/dnet mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = sbin_PROGRAMS = dnet$(EXEEXT) PROGRAMS = $(sbin_PROGRAMS) am_dnet_OBJECTS = addr.$(OBJEXT) arp.$(OBJEXT) aton.$(OBJEXT) \ dnet.$(OBJEXT) eth.$(OBJEXT) fw.$(OBJEXT) hex.$(OBJEXT) \ icmp.$(OBJEXT) intf.$(OBJEXT) ip.$(OBJEXT) rand.$(OBJEXT) \ route.$(OBJEXT) send.$(OBJEXT) tcp.$(OBJEXT) udp.$(OBJEXT) dnet_OBJECTS = $(am_dnet_OBJECTS) dnet_DEPENDENCIES = $(top_builddir)/src/libdnet.la dnet_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(dnet_SOURCES) NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(dnet_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/dnet/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dnet$(EXEEXT): $(dnet_OBJECTS) $(dnet_DEPENDENCIES) @rm -f dnet$(EXEEXT) $(LINK) $(dnet_LDFLAGS) $(dnet_OBJECTS) $(dnet_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `cygpath -w $<` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: man8dir = $(mandir)/man8 install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man8dir) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-sbinPROGRAMS install-info: install-info-am install-man: install-man8 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS uninstall-man: uninstall-man8 .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-man8 install-sbinPROGRAMS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ tags uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-man8 uninstall-sbinPROGRAMS dnet.8.txt: dnet.8 groff -t -e -mdoc -Tascii dnet.8 | col -bx > $@ # 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: libdnet-1.12/trunk/test/dnet/mod.h0000644000076500007650000000073307451002237020235 0ustar dugsongdugsong00000000000000/* * mod.h * * Copyright (c) 2002 Dug Song * * $Id: mod.h 316 2002-03-29 06:07:27Z dugsong $ */ #ifndef MOD_H #define MOD_H struct mod { char *name; int type; int (*main)(int argc, char *argv[]); }; /* * Module types */ #define MOD_TYPE_DATA 0x01 /* generate data */ #define MOD_TYPE_ENCAP 0x02 /* encapsulate data */ #define MOD_TYPE_XMIT 0x04 /* send datagrams */ #define MOD_TYPE_KERN 0x08 /* kernel network info */ #endif /* MOD_H */ libdnet-1.12/trunk/test/dnet/rand.c0000644000076500007650000000152507451002265020376 0ustar dugsongdugsong00000000000000/* * rand.c * * Copyright (c) 2001 Dug Song * * $Id: rand.c 317 2002-03-29 06:07:49Z dugsong $ */ #include "config.h" #include #include #include #include #include #include "dnet.h" #include "mod.h" void rand_usage(void) { fprintf(stderr, "Usage: dnet rand \n"); exit(1); } int rand_main(int argc, char *argv[]) { rand_t *r; int len; u_char *p; if (argc != 2 || *(argv[1]) == '-') rand_usage(); if ((len = atoi(argv[1])) == 0) rand_usage(); if ((p = malloc(len)) == NULL) err(1, "malloc"); if ((r = rand_open()) == NULL) err(1, "rand_init"); if (rand_get(r, p, len) < 0) err(1, "rand_get"); if (write(STDOUT_FILENO, p, len) != len) err(1, "write"); return (0); } struct mod mod_rand = { "rand", MOD_TYPE_DATA, rand_main }; libdnet-1.12/trunk/test/dnet/route.c0000644000076500007650000000431207450775224020620 0ustar dugsongdugsong00000000000000/* * route.c * * Copyright (c) 2001 Dug Song * * $Id: route.c 311 2002-03-29 05:24:36Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "mod.h" static void usage(void) { fprintf(stderr, "Usage: dnet route show\n" " dnet route get \n" " dnet route add \n" " dnet route delete \n"); exit(1); } static int print_route(const struct route_entry *entry, void *arg) { printf("%-20s %-20s\n", addr_ntoa(&entry->route_dst), addr_ntoa(&entry->route_gw)); return (0); } int route_main(int argc, char *argv[]) { struct route_entry entry; route_t *r; char *cmd; if (argc < 2) usage(); cmd = argv[1]; if ((r = route_open()) == NULL) err(1, "route_open"); if (strcmp(cmd, "show") == 0) { printf("%-20s %-20s\n", "Destination", "Gateway"); if (route_loop(r, print_route, NULL) < 0) err(1, "route_loop"); } else if (strcmp(cmd, "get") == 0) { if (addr_aton(argv[2], &entry.route_dst) < 0) err(1, "addr_aton"); if (route_get(r, &entry) < 0) err(1, "route_get"); printf("get %s %s: gateway %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst), addr_ntoa(&entry.route_gw)); } else if (strcmp(cmd, "add") == 0) { if (argc < 4 || addr_aton(argv[2], &entry.route_dst) < 0 || addr_aton(argv[3], &entry.route_gw) < 0) err(1, "addr_aton"); if (route_add(r, &entry) < 0) err(1, "route_add"); printf("add %s %s: gateway %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst), addr_ntoa(&entry.route_gw)); } else if (strcmp(cmd, "delete") == 0) { if (addr_aton(argv[2], &entry.route_dst) < 0) err(1, "addr_aton"); if (route_delete(r, &entry) < 0) err(1, "route_delete"); printf("delete %s %s\n", (entry.route_dst.addr_bits < IP_ADDR_BITS) ? "net" : "host", addr_ntoa(&entry.route_dst)); } else usage(); route_close(r); exit(0); } struct mod mod_route = { "route", MOD_TYPE_KERN, route_main }; libdnet-1.12/trunk/test/dnet/send.c0000644000076500007650000000231407430700671020403 0ustar dugsongdugsong00000000000000/* * send.c * * Copyright (c) 2002 Dug Song * * $Id: send.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void send_usage(void) { fprintf(stderr, "Usage: dnet send []\n"); exit(1); } int send_main(int argc, char *argv[]) { eth_t *eth; ip_t *ip; u_char *p, buf[IP_LEN_MAX]; /* XXX */ int c, len; if (argc == 2 && *(argv[1]) == '-') send_usage(); if (isatty(STDIN_FILENO)) errx(1, "can't read packet to send from tty"); p = buf; len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } len = p - buf; if (argc == 1) { if ((ip = ip_open()) == NULL) err(1, "ip_open"); if (ip_send(ip, buf, len) != len) err(1, "ip_send"); ip_close(ip); } else if (argc == 2) { if ((eth = eth_open(argv[1])) == NULL) err(1, "eth_open"); if (eth_send(eth, buf, len) != len) err(1, "eth_send"); eth_close(eth); } else send_usage(); exit(0); } struct mod mod_send = { "send", MOD_TYPE_XMIT, send_main }; libdnet-1.12/trunk/test/dnet/tcp.c0000644000076500007650000000406007430700671020240 0ustar dugsongdugsong00000000000000/* * tcp.c * * Copyright (c) 2001 Dug Song * * $Id: tcp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void tcp_usage(void) { fprintf(stderr, "Usage: dnet tcp [sport|dport|flags|seq|ack|" "win|urp ] ...\n"); exit(1); } int tcp_main(int argc, char *argv[]) { struct tcp_hdr *tcp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); tcp = (struct tcp_hdr *)buf; memset(tcp, 0, sizeof(*tcp)); tcp->th_sport = rand() & 0xffff; tcp->th_dport = rand() & 0xffff; tcp->th_seq = rand(); tcp->th_ack = 0; tcp->th_off = 5; tcp->th_flags = TH_SYN; tcp->th_win = TCP_WIN_MAX; tcp->th_urp = 0; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "sport") == 0) { if (port_aton(value, &tcp->th_sport) < 0) tcp_usage(); } else if (strcmp(name, "dport") == 0) { if (port_aton(value, &tcp->th_dport) < 0) tcp_usage(); } else if (strcmp(name, "flags") == 0) { if (flags_aton(value, &tcp->th_flags) < 0) tcp_usage(); } else if (strcmp(name, "seq") == 0) { if (seq_aton(value, &tcp->th_seq) < 0) tcp_usage(); } else if (strcmp(name, "ack") == 0) { if (seq_aton(value, &tcp->th_ack) < 0) tcp_usage(); } else if (strcmp(name, "win") == 0) { if (port_aton(value, &tcp->th_win) < 0) tcp_usage(); } else if (strcmp(name, "urp") == 0) { if (port_aton(value, &tcp->th_urp) < 0) tcp_usage(); } else tcp_usage(); } argc -= c; argv += c; if (argc != 0) tcp_usage(); p = buf + TCP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_tcp = { "tcp", MOD_TYPE_ENCAP, &tcp_main }; libdnet-1.12/trunk/test/dnet/udp.c0000644000076500007650000000265407430700671020251 0ustar dugsongdugsong00000000000000/* * udp.c * * Copyright (c) 2001 Dug Song * * $Id: udp.c 279 2002-02-08 07:43:53Z dugsong $ */ #include "config.h" #include #include #include #include #include #include #include #include "dnet.h" #include "aton.h" #include "mod.h" void udp_usage(void) { fprintf(stderr, "Usage: dnet udp [sport|dport ] ...\n"); exit(1); } int udp_main(int argc, char *argv[]) { struct udp_hdr *udp; u_char *p, buf[IP_LEN_MAX]; /* XXX */ char *name, *value; int c, len; srand(time(NULL)); udp = (struct udp_hdr *)buf; memset(udp, 0, sizeof(*udp)); udp->uh_sport = rand() & 0xffff; udp->uh_dport = rand() & 0xffff; for (c = 1; c + 1 < argc; c += 2) { name = argv[c]; value = argv[c + 1]; if (strcmp(name, "sport") == 0) { if (port_aton(value, &udp->uh_sport) < 0) udp_usage(); } else if (strcmp(name, "dport") == 0) { if (port_aton(value, &udp->uh_dport) < 0) udp_usage(); } else udp_usage(); } argc -= c; argv += c; if (argc != 0) udp_usage(); p = buf + UDP_HDR_LEN; if (!isatty(STDIN_FILENO)) { len = sizeof(buf) - (p - buf); while ((c = read(STDIN_FILENO, p, len)) > 0) { p += c; len -= c; } } len = p - buf; udp->uh_ulen = htons(len); if (write(STDOUT_FILENO, buf, len) != len) err(1, "write"); return (0); } struct mod mod_udp = { "udp", MOD_TYPE_ENCAP, udp_main }; libdnet-1.12/trunk/test/Makefile.am0000644000076500007650000000017007530352364020411 0ustar dugsongdugsong00000000000000## $Id: Makefile.am 361 2002-08-20 05:34:44Z dugsong $ include $(top_srcdir)/Makefile.am.common SUBDIRS = check dnet libdnet-1.12/trunk/test/Makefile.in0000644000076500007650000002421110363627052020421 0ustar dugsongdugsong00000000000000# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AWK = @AWK@ CC = @CC@ CHECKINC = @CHECKINC@ CHECKLIB = @CHECKLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EGREP = @EGREP@ F77 = @F77@ GCJ = @GCJ@ GCJFLAGS = @GCJFLAGS@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ OBJDUMP = @OBJDUMP@ PACKAGE = @PACKAGE@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RC = @RC@ STRIP = @STRIP@ TCLINC = @TCLINC@ TCLLIB = @TCLLIB@ VERSION = @VERSION@ ac_aux_dir = @ac_aux_dir@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_CPPFLAGS = -I$(top_srcdir)/include SUBDIRS = check dnet subdir = test mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # 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: libdnet-1.12/trunk/THANKS0000644000076500007650000000450610205004103016272 0ustar dugsongdugsong00000000000000# $Id: THANKS 596 2005-02-17 02:58:11Z dugsong $ many thanks to all the folks who have contributed to libdnet: Thamer Al-Harbash excellent bug reports and fearless beta-testing Marc Bevand RFC 768 UDP zero-checksum fix Michael Coulter OpenBSD pfioc_pooladdr fix, pf rule deletion bug report Michael A. Davis win32 code cleanup Scott Dawson interface alias fix Ben Fleis constification and code cleanup Mike Frantzen dnet hex test module fix Markus Friedl BSD/OS testing and autoconf fixes Tangy Gnat missing queue.h Loren Gorden many thorough, detailed bug reports and fixes Eric Jackson OpenBSD-alpha testing Juan plugged BPF fd leak on failure K2 HP-UX, OSF1, UnixWare, Solaris x86, Slackware, etc. access Kirby Kuehl win32 and OpenBSD updates David Lee addr_btos() bugfixes Kuk-hyeon Lee C++ support fixes Robert Lowe Tru64 access, and allowing me to crash his machine Dominic Marks FreeBSD 5 ipfw port fixes Jose Nazario IRIX access, and allowing me to crash his machine Nergal TCP sequence number handling fixes Peter C. Norton Linux port fixes plaguez for convincing me to write this, and suffering my bad French NN Poster RPM spec file Niels Provos many bugfixes and much encouragement Andrew Reiter help with ipfw braindeath John S VPATH build bug report Federico Sacerdoti dotted-quad IPv4 netmask support in addr_pton() Mike Schiffman inspiration via libnet Matt Smart caught pastos Matt Sommers BSD/OS testing Mike Stolarchuk enlightening discussion of *ntoa optimizations Greg Taleck OpenBSD pf bug reporting Christophe Ternat route-bsd.c fork() bug report xs NetBSD testing libdnet-1.12/trunk/TODO0000644000076500007650000000621510204217253016061 0ustar dugsongdugsong00000000000000ipfw2 on FreeBSD/5 (5.1 has pf) optimize port wildcard rules for each firewall type - e.g. using ipf FR_NONE, pf PF_OP_NONE, etc. ipchains sleazy exec audit addr_ntos() for non-zero'd host bits make *_loop() prevent modification within loop, or modify only post-iteration prefix everything with dnet_*, maybe new API with common dnet_t handle? more documentation and example code ip-cooked.c: use RTM_RESOLVE for ip_lookup_mac() (GetBestInterface()?) add a way to enable ip forwarding? finish IPv6 support everywhere (fw, route, ip6, win32, etc.) reimplement win32 fw (lost with laptop hd crash!@#$%) NAT, ipsec interface? maybe Checkpoint FW-1 support, via OPSEC (hrr) --------+------+-----+-----+----+----+------+-------+-----+ | addr | arp | eth | fw | ip | intf | route | tun | --------+------+-----+-----+----+----+------+-------+-----+ openbsd | | | | | | | | | --------+------+-----+-----+----+----+------+-------+-----+ freebsd | | | | 1 | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ netbsd | | | | | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ linux | | | | | | | | | --------+------+-----+-----+----+----+------+-------+-----+ solaris | | | | 7 | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ macosx | | | | | | | | ? | --------+------+-----+-----+----+----+------+-------+-----+ irix | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ bsdi | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ tru64 | | | | 7 | | | | - | --------+------+-----+-----+----+----+------+-------+-----+ hp-ux | | | | 7 | | 3 | | - | --------+------+-----+-----+----+----+------+-------+-----+ win32 | | | | | | 3 | | - | --------+------+-----+-----+----+----+------+-------+-----+ unixware| | - | 2 | - | - | | 4 | - | --------+------+-----+-----+----+----+------+-------+-----+ aix | | 5 | - | - | - | | 6 | - | --------+------+-----+-----+----+----+------+-------+-----+ = works, tested 1 = ipfw support, but no ipfw2 ? = untested 2 = eth_send doesn't work - = unimplemented 3 = intf_set doesn't work 4 = route_loop only works 5 = arp_show doesn't work 6 = route_loop doesn't work 7 = IP Filter should work, but untested arp-{bsd,ioctl} both b0rked on unixware eth_send() doesn't allow src mac spoofing on MacOS X (no BIOCSHDRCMPLT) without patch (http://slagheap.net/etherspoof/), also b0rked on BSD/OS, says markus. not possible on Tru64? no support for ICMP code in ipfw, therefore none in fw-ipfw.c need reliable, legit HP-UX, Unixware, and AIX accounts with root access to finish the ports to those platforms. i'd be happy to port to other platforms also, given similar (temporary) access. $Id: TODO 582 2005-02-14 21:56:59Z dugsong $